Skip to content

Commit

Permalink
Use pyproject.toml for metadata and trusted publishers for deployment (
Browse files Browse the repository at this point in the history
…#48)

- **Use trusted publishers mechanism to upload to PyPI**
- **Add project info to pyproject.toml**
- **Remove outdated metadata files**
- **Add napari core devs to author list**
  • Loading branch information
jni authored Jun 24, 2024
1 parent dfd90a5 commit 921a275
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 64 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
needs: [test]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -91,12 +93,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
pip install -U setuptools setuptools_scm wheel build twine
- name: Build
run: |
git tag
python setup.py sdist bdist_wheel
twine upload dist/*
python -m build
twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
61 changes: 60 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
[project]
name = "napari-svg"
description = "A plugin for writing svg files with napari"
license = {text = "BSD-3"}
authors = [
{name = "Nicholas Sofroniew", email = "[email protected]"},
{name = "napari core devs", email = "[email protected]"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Framework :: napari",
"Topic :: Software Development :: Testing",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"License :: OSI Approved :: BSD License",
]
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.9"
dependencies = [
"imageio>=2.5.0",
"numpy>=1.16.0",
"vispy>=0.6.4",
]
dynamic = ["version"]

[project.optional-dependencies]
testing = [
"napari>=0.4",
"pyqt5",
"pytest",
"pytest-cov",
]

[project.entry-points."napari.manifest"]
napari-svg = "napari_svg:napari.yaml"

[project.urls]
Source = 'https://github.com/napari/napari-svg'
"Bug Tracker" = 'https://github.com/napari/napari-svg/issues'

[build-system]
requires = [
"setuptools >= 56",
Expand All @@ -7,4 +53,17 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "napari_svg/_version.py"
write_to = "napari_svg/_version.py"

[tool.setuptools]
include-package-data = true
license-files = ['LICENSE']
zip-safe = false

[tool.setuptools.packages.find]
include = ['napari_svg']
exclude = ['docs']
namespaces = false

[tool.setuptools.package-data]
napari_svg = ['*napari.yaml']
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/default.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements/test.txt

This file was deleted.

49 changes: 0 additions & 49 deletions setup.cfg

This file was deleted.

0 comments on commit 921a275

Please sign in to comment.