|
622 | 622 | "execution_count": null, |
623 | 623 | "id": "6c2a835d", |
624 | 624 | "metadata": {}, |
625 | | - "outputs": [ |
626 | | - { |
627 | | - "data": { |
628 | | - "text/markdown": [ |
629 | | - "<div class=\"prose\">\n", |
630 | | - "\n", |
631 | | - "```python\n", |
632 | | - "print(create_output('text', 'text/plain'))\n", |
633 | | - "```\n", |
634 | | - "\n", |
635 | | - "</div>" |
636 | | - ], |
637 | | - "text/plain": [ |
638 | | - "Markdown(```python\n", |
639 | | - "print(create_output('text', 'text/plain'))\n", |
640 | | - "```)" |
641 | | - ] |
642 | | - }, |
643 | | - "execution_count": 34, |
644 | | - "metadata": {}, |
645 | | - "output_type": "execute_result" |
646 | | - } |
647 | | - ], |
| 625 | + "outputs": [], |
648 | 626 | "source": [ |
649 | 627 | "show_src(\"print(create_output('text', 'text/plain'))\")" |
650 | 628 | ] |
|
677 | 655 | "\n", |
678 | 656 | "[tool.uv]\n", |
679 | 657 | "cache-keys = [{ file = \"pyproject.toml\" }, { file = \"setup.py\" }]\n", |
| 658 | + "\n", |
| 659 | + "[[tool.uv.index]]\n", |
| 660 | + "name = \"pytorch-cpu\"\n", |
| 661 | + "url = \"https://download.pytorch.org/whl/cpu\"\n", |
| 662 | + "explicit = true\n", |
680 | 663 | "\"\"\"" |
681 | 664 | ] |
682 | 665 | }, |
|
833 | 816 | " if get_config().get('update_pyproject', True): update_proj(path.parent)" |
834 | 817 | ] |
835 | 818 | }, |
| 819 | + { |
| 820 | + "cell_type": "code", |
| 821 | + "execution_count": null, |
| 822 | + "id": "066be7c6", |
| 823 | + "metadata": {}, |
| 824 | + "outputs": [], |
| 825 | + "source": [ |
| 826 | + "with tempfile.TemporaryDirectory() as d:\n", |
| 827 | + " d = Path(d)\n", |
| 828 | + " cfg_text = (pyproj_tmpl.replace('name = \"FILL_IN\"', 'name = \"testpkg\"').replace('requires-python=\"FILL_IN\"', 'requires-python=\">=3.10\"'))\n", |
| 829 | + " cfg_text += '\\n[tool.nbdev]\\n'\n", |
| 830 | + " (d/_pyproj).write_text(cfg_text)\n", |
| 831 | + " (d/'testpkg').mkdir()\n", |
| 832 | + "\n", |
| 833 | + " with working_directory(d):\n", |
| 834 | + " update_proj(d)\n", |
| 835 | + "\n", |
| 836 | + " result = (d/_pyproj).read_text()\n", |
| 837 | + " assert 'name = \"testpkg\"' in result\n", |
| 838 | + " assert 'name = \"pytorch-cpu\"' in result, \"update_proj incorrectly modified the uv index name!\"" |
| 839 | + ] |
| 840 | + }, |
836 | 841 | { |
837 | 842 | "cell_type": "markdown", |
838 | 843 | "id": "63b789b2", |
|
947 | 952 | ] |
948 | 953 | } |
949 | 954 | ], |
950 | | - "metadata": { |
951 | | - "solveit_dialog_mode": "learning", |
952 | | - "solveit_ver": 2 |
953 | | - }, |
| 955 | + "metadata": {}, |
954 | 956 | "nbformat": 4, |
955 | 957 | "nbformat_minor": 5 |
956 | 958 | } |
0 commit comments