From 96d5c8aa387349cd5c2d62fd6a2f62a05a6636ad Mon Sep 17 00:00:00 2001 From: rubenperezm Date: Sun, 6 Oct 2024 15:48:06 +0200 Subject: [PATCH] ci: publish to testpypi --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ .gitignore | 2 ++ pyproject.toml | 27 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f392381 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish package to PyPI + +on: + release: + types: + - created + +jobs: + build: + name: Build and Publish to PyPI + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://test.pypi.org/p/pystrukts + + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - uses: ./.github/actions/test + + - name: Package the extension + run: | + pip install build + python -m build --sdist + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 82f9275..6523844 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,5 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +src/_version.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ce0fe01 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "pystrukts" +description = "Advanced data structures for Python." +readme = "README.md" +requires-python = ">=3.8" +dynamic = ["version"] +license = { file = "LICENSE" } + +dependencies = [ +] + +authors = [ + { name = "Rubén Pérez Mercado", email = "rubenpermerc@gmail.com" } +] + +[tool.setuptools_scm] +write_to = "pystrukts/_version.py" + +[project.optional-dependencies] +dev = [ + "pytest>=6.0", + "pylint", +]