diff --git a/.github/workflows/publish-pypi.yaml b/.github/workflows/publish-pypi.yaml new file mode 100644 index 00000000..49aa9bdc --- /dev/null +++ b/.github/workflows/publish-pypi.yaml @@ -0,0 +1,36 @@ +name: publish-pypi + +on: + push: + tags: + - v* + +jobs: + publish-pypi: + name: Publish distribution 📦s to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/sdf + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install pypa/build + run: python -m pip install build twine --upgrade --user + + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ . + + - name: Check with twine + run: twine check dist/* + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..8f118762 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[project] +name = "sdf" +version = "0.1" +description = "Generate 3D meshes from signed distance functions." +authors = [{ name = "Michael Fogleman", email = "michael.fogleman@gmail.com" }] +license = { text = "MIT" } +readme = "README.md" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] +dependencies = [ + "matplotlib", + "meshio", + "numpy", + "scikit-image>=0.17", + "scipy", + "Pillow", +] + +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["sdf"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 72417e67..00000000 --- a/setup.py +++ /dev/null @@ -1,27 +0,0 @@ -from setuptools import setup - -setup( - name='sdf', - version='0.1', - description='Generate 3D meshes from signed distance functions.', - author='Michael Fogleman', - author_email='michael.fogleman@gmail.com', - packages=['sdf'], - install_requires=[ - 'matplotlib', - 'meshio', - 'numpy', - 'scikit-image>=0.17', - 'scipy', - 'Pillow', - ], - license='MIT', - classifiers=( - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - ), -)