From 2093ec6aa3f0c28acf87a07ba9817731301662e9 Mon Sep 17 00:00:00 2001 From: Alex Remedios Date: Mon, 23 Dec 2024 18:24:55 +0000 Subject: [PATCH] uv publish (#132) --- .github/workflows/publish-to-pypi.yml | 3 +- .github/workflows/pytest.yml | 3 +- .github/workflows/test-publish-to-pypi.yml | 3 +- .gitignore | 1 + pyproject.toml | 17 ++++++--- src/nbmake/__init__.py | 0 uv.lock | 40 ++++++++++++++++++++-- 7 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 src/nbmake/__init__.py diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 902568d..4b538c2 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -10,8 +10,7 @@ jobs: - uses: actions/setup-python@v2 - run: pip install uv - run: uv build - - run: pip install twine==4.0.1 - - run: twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} + - run: uv publish -t ${{ secrets.PYPI_API_TOKEN }} - uses: EndBug/add-and-commit@v7.0.0 with: author_name: github-actions diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c1c3103..4ced514 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -12,7 +12,8 @@ jobs: - run: npm install -g @devcontainers/cli@v0.72.0 - run: devcontainer up --workspace-folder=. - run: devcontainer exec --workspace-folder=. uv venv - - run: devcontainer exec --workspace-folder=. uv pip install pre-commit pytest + - run: devcontainer exec --workspace-folder=. uv lock --check -p 3.11 + - run: devcontainer exec --workspace-folder=. uv pip install -e . - run: devcontainer exec --workspace-folder=. uv run pre-commit run --verbose --all-files - run: devcontainer exec --workspace-folder=. uv run pytest pytest: diff --git a/.github/workflows/test-publish-to-pypi.yml b/.github/workflows/test-publish-to-pypi.yml index 778fedc..415fa6c 100644 --- a/.github/workflows/test-publish-to-pypi.yml +++ b/.github/workflows/test-publish-to-pypi.yml @@ -16,5 +16,4 @@ jobs: - run: pytest --nbmake tests/resources/mock.ipynb - run: pip install dist/*whl --force-reinstall - run: pytest --nbmake tests/resources/mock.ipynb - - run: pip install twine==4.0.1 - - run: twine upload -r testpypi dist/* -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} + - run: uv publish --check-url https://test.pypi.org/project/nbmake/ --publish-url "https://test.pypi.org/legacy/" -t ${{ secrets.TEST_PYPI_API_TOKEN }} diff --git a/.gitignore b/.gitignore index ed77bde..7435540 100644 --- a/.gitignore +++ b/.gitignore @@ -134,3 +134,4 @@ typeshed trash **/_build .aider* +scratch/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 59185c9..6a739ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ requires-python = ">=3.8.0" dependencies = [ "pytest>=6.1.0", "nbclient>=0.6.6", - "nbformat>=5.0.8", + "nbformat>=5.0.4", "Pygments>=2.7.3", "ipykernel>=5.4.0", ] @@ -23,14 +23,23 @@ nbmake = "nbmake.pytest_plugin" Homepage = "https://github.com/treebeardtech/nbmake" [build-system] -requires = ["setuptools>=65.0.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" [dependency-groups] dev = [ + "hatchling>=1.27.0", "pre-commit>=3.5.0", "pytest-xdist>=3.6.1", "ruff>=0.8.4", - "pytest>=8.1", "typing-extensions>=4.12.2", ] + +# [[tool.uv.index]] +# url = "https://pypi.org/simple" +# default = true + +# [[tool.uv.index]] +# name = "testpypi" +# url = "https://test.pypi.org/simple/" +# publish-url = "https://test.pypi.org/legacy/" \ No newline at end of file diff --git a/src/nbmake/__init__.py b/src/nbmake/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/uv.lock b/uv.lock index 9a04ddc..cb406d3 100644 --- a/uv.lock +++ b/uv.lock @@ -245,6 +245,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b9/f8/feced7779d755758a52d1f6635d990b8d98dc0a29fa568bbe0625f18fdf3/filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0", size = 16163 }, ] +[[package]] +name = "hatchling" +version = "1.27.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "pathspec" }, + { name = "pluggy" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "trove-classifiers" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8f/8a/cc1debe3514da292094f1c3a700e4ca25442489731ef7c0814358816bb03/hatchling-1.27.0.tar.gz", hash = "sha256:971c296d9819abb3811112fc52c7a9751c8d381898f36533bb16f9791e941fd6", size = 54983 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/08/e7/ae38d7a6dfba0533684e0b2136817d667588ae3ec984c1a4e5df5eb88482/hatchling-1.27.0-py3-none-any.whl", hash = "sha256:d3a2f3567c4f926ea39849cdf924c7e99e6686c9c8e288ae1037c8fa2a5d937b", size = 75794 }, +] + [[package]] name = "identify" version = "2.6.1" @@ -580,9 +596,9 @@ dependencies = [ [package.dev-dependencies] dev = [ + { name = "hatchling" }, { name = "pre-commit", version = "3.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9'" }, { name = "pre-commit", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9'" }, - { name = "pytest" }, { name = "pytest-xdist" }, { name = "ruff" }, { name = "typing-extensions" }, @@ -592,15 +608,15 @@ dev = [ requires-dist = [ { name = "ipykernel", specifier = ">=5.4.0" }, { name = "nbclient", specifier = ">=0.6.6" }, - { name = "nbformat", specifier = ">=5.0.8" }, + { name = "nbformat", specifier = ">=5.0.4" }, { name = "pygments", specifier = ">=2.7.3" }, { name = "pytest", specifier = ">=6.1.0" }, ] [package.metadata.requires-dev] dev = [ + { name = "hatchling", specifier = ">=1.27.0" }, { name = "pre-commit", specifier = ">=3.5.0" }, - { name = "pytest", specifier = ">=8.1" }, { name = "pytest-xdist", specifier = ">=3.6.1" }, { name = "ruff", specifier = ">=0.8.4" }, { name = "typing-extensions", specifier = ">=4.12.2" }, @@ -642,6 +658,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c6/ac/dac4a63f978e4dcb3c6d3a78c4d8e0192a113d288502a1216950c41b1027/parso-0.8.4-py2.py3-none-any.whl", hash = "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18", size = 103650 }, ] +[[package]] +name = "pathspec" +version = "0.12.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191 }, +] + [[package]] name = "pexpect" version = "4.9.0" @@ -1377,6 +1402,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl", hash = "sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f", size = 85359 }, ] +[[package]] +name = "trove-classifiers" +version = "2024.10.21.16" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/99/85/92c2667cf221b37648041ce9319427f92fa76cbec634aad844e67e284706/trove_classifiers-2024.10.21.16.tar.gz", hash = "sha256:17cbd055d67d5e9d9de63293a8732943fabc21574e4c7b74edf112b4928cf5f3", size = 16153 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/35/5055ab8d215af853d07bbff1a74edf48f91ed308f037380a5ca52dd73348/trove_classifiers-2024.10.21.16-py3-none-any.whl", hash = "sha256:0fb11f1e995a757807a8ef1c03829fbd4998d817319abcef1f33165750f103be", size = 13546 }, +] + [[package]] name = "typing-extensions" version = "4.12.2"