From f5aae9a261ab98930f9086bf1546e45e35656a99 Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Wed, 30 Aug 2023 12:08:55 +0200 Subject: [PATCH] Build upload with `build` and `twine` (#89) * change toml to new metadata * update workflow to use build and twine for upload --- .github/workflows/pypi-publish.yml | 9 +++++---- pyproject.toml | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 1f8611c..f2e7fed 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -22,11 +22,12 @@ jobs: sudo apt-get update sudo apt-get -y install libegl1-mesa python -m pip install --upgrade pip - pip install flit flit-scm setuptools-scm + pip install build twine pip install . - name: Build and publish env: - FLIT_USERNAME: '__token__' - FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }} + PYPI_USERNAME: '__token__' + PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - flit publish + python -m build + python -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD diff --git a/pyproject.toml b/pyproject.toml index bc3accd..babecd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,12 @@ requires = ["flit_scm"] build-backend = "flit_scm:buildapi" -[tool.flit.metadata] -module = "rimseval" -author = "Reto Trappitsch" -author-email = "reto@galactic-forensics.space" -home-page = "https://github.com/RIMS-Code/RIMSEval" -requires = [ +[project] +name = "rimseval" +authors = [ + {name="Reto Trappitsch", email="reto@galactic-forensics.space"} + ] +dependencies = [ "iniabu>=1.1.2", "matplotlib", "numba~=0.57.1", @@ -18,9 +18,14 @@ requires = [ ] requires-python=">=3.8,<3.12" classifiers = [ "License :: OSI Approved :: MIT License",] -description-file = "README.rst" +readme = "README.rst" +dynamic = ["version", "description"] -[tool.flit.metadata.requires-extra] +[project.urls] +Source = "https://github.com/RIMS-Code/RIMSEval" +Documentation = "https://rimseval.readthedocs.io" + +[project.optional-dependencies] dev = [ "darglint>=1.5.1", "flake8", @@ -49,5 +54,8 @@ minversion = "6.0" addopts = "--cov=rimseval -v" testpaths = "tests" +[tool.flit.sdist] +exclude = [".gitignore", ".readthedocs.yaml"] + [tool.setuptools_scm] write_to = "rimseval/_version.py"