Skip to content

Commit

Permalink
Replace setup.py with pyproject.toml (#16)
Browse files Browse the repository at this point in the history
* Replace setup.py with pyproject.toml

* Update workflow to use improved project metadata

* Remove requirements.txt

* Update tox.ini

* Install tox-gh-actions in gh actions workflow

* Use correct variable for Python version
  • Loading branch information
jni authored Feb 14, 2024
1 parent fdba754 commit 7997fdf
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 78 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python }}

# these libraries enable testing Qt on Linux
- uses: tlambert03/setup-qt-libs@v1

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools tox tox-gh-actions
# python -m pip install .[all,testing] # use when adding test deps
python -m pip install .
python -m pip install tox-gh-actions
python -m pip install .[dev,testing]
- name: Test with tox
run: tox
Expand All @@ -72,13 +71,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools_scm build wheel
python -m pip install .[dev,testing]
- name: Build
run: |
git tag
# python -m build # change to this when updating to pyproject.toml
python setup.py sdist bdist_wheel
python -m build
- name: Publish to PyPI
uses: pypa/gh-actions-pypi-publish@release/v1
68 changes: 68 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[project]
name = 'napari-tiff'
description = 'official napari tiff reader and writer.'
readme = 'README.md'
dynamic = ['version']
authors = [
{name = 'Genevieve Buckley'},
{name = 'napari core developers', email = '[email protected]'},
{name = 'napari-tiff contributors'},
]
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Framework :: napari',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Software Development :: Libraries',
'Topic :: Scientific/Engineering',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'License :: OSI Approved :: BSD License',
]
requires-python = '>=3.10'
dependencies = [
'imagecodecs',
'numpy',
'tifffile>=2020.5.7',
'vispy',
]

[project.optional-dependencies]
testing = [
'pytest',
]

dev = [
'tox',
]

[tools.setuptools]
include-package-data = true

[tools.setuptools.package-data]
napari-tiff = ['*napari.yaml']

[project.entry-points.'napari.manifest']
napari-tiff = 'napari_tiff:napari.yaml'

[project.license]
file = 'LICENSE'

[project.urls]
# homepage = ''
# documentation = ''
source = 'https://github.com/napari/napari-tiff'
tracker = 'https://github.com/napari/napari-tiff/issues'

[build-system]
requires = ['setuptools', 'setuptools_scm', 'wheel']
build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]
write_to = 'napari_tiff/_version.py'
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

59 changes: 0 additions & 59 deletions setup.py

This file was deleted.

13 changes: 6 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{36,37,38}-{linux,macos,windows}
envlist = {linux,macos,windows}-py{310,312}

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38

3.10: py310
3.12: py312

[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
Expand All @@ -16,6 +15,6 @@ PLATFORM =

[testenv]
commands = pytest -v --cov=./ --cov-report=xml
deps =
deps =
pytest-cov # https://pytest-cov.readthedocs.io/en/latest/
pytest # https://docs.pytest.org/en/latest/contents.html
pytest # https://docs.pytest.org/en/latest/contents.html

0 comments on commit 7997fdf

Please sign in to comment.