Skip to content

Commit

Permalink
Move project metadata to pyproject.toml; avoid calling setup.py (pyvi…
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored Nov 21, 2022
1 parent 887323c commit 80185ea
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 108 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:

- name: Create PyVista package
run: |
python setup.py sdist
pip install build
python -m build --sdist
- name: Log into the Container registry
uses: docker/login-action@v2
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:

- name: Install PyVista
run: |
pip install wheel
pip install .
python -c "import pyvista;print(pyvista.Report(gpu=False));from pyvista import examples;print('User data path:', examples.USER_DATA_PATH)"
Expand Down Expand Up @@ -163,8 +162,8 @@ jobs:
- name: Build wheel and install pyvista
run: |
pip install wheel
python setup.py bdist_wheel
pip install build
python -m build --wheel
pip install dist/pyvista*.whl
- name: Set up vtk
Expand Down Expand Up @@ -194,9 +193,9 @@ jobs:

- name: Check package
run: |
pip install twine
python setup.py sdist
twine check dist/*
pip install build twine
python -m build
twine check --strict dist/*
- name: Upload to PyPi
if: matrix.python-version == '3.9' && startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -231,7 +230,6 @@ jobs:

- name: Install PyVista
run: |
pip install wheel
pip install .
python -c "import pyvista; print(pyvista.Report(gpu=False)); from pyvista import examples; print('User data path:', examples.USER_DATA_PATH)"
Expand Down
3 changes: 2 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PyVista in Jupyter Lab!
Clone PyVista and run the following at the top level of the project:

```bash
python setup.py sdist
pip install build
python -m build --sdist
docker build -t my-pyvista-jupyterlab -f docker/jupyter.Dockerfile
```
91 changes: 91 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,94 @@
[build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta'

[project]
name = 'pyvista'
description = 'Easier Pythonic interface to VTK'
authors = [
{name = 'PyVista Developers', email = '[email protected]'},
]
readme = 'README.rst'
requires-python = '>=3.7'
keywords = ['vtk', 'numpy', 'plotting', 'mesh']
license = {text = 'MIT'}
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Information Analysis',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: MacOS',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
]
dependencies = [
'imageio',
'numpy',
'pillow',
'pooch',
'scooby>=0.5.1',
"typing-extensions; python_version < '3.8'",
'vtk',
]
dynamic = ['version']

[project.optional-dependencies]
all = [
'cmocean',
'colorcet',
'ipyvtklink',
'matplotlib',
'meshio>=5.2',
'panel',
'pythreejs',
]
colormaps = [
'cmocean',
'colorcet',
'matplotlib',
]
io = ['meshio>=5.2']
jupyter = [
'ipyvtklink',
'panel',
'pythreejs',
]

[project.urls]
Documentation = 'https://docs.pyvista.org/'
"Bug Tracker" = 'https://github.com/pyvista/pyvista/issues'
"Source Code" = 'https://github.com/pyvista/pyvista'

[tool.setuptools.dynamic]
version = {attr = 'pyvista._version.__version__'}

[tool.setuptools.packages.find]
include = [
'pyvista',
'pyvista.*',
]

[tool.setuptools.package-data]
pyvista = [
'py.typed',
]
"pyvista.examples" = [
'2k_earth_daymap.jpg',
'airplane.ply',
'ant.ply',
'channels.vti',
'globe.vtk',
'hexbeam.vtk',
'nut.ply',
'rectilinear.vtk',
'sphere.ply',
'uniform.vtk',
]

[tool.isort]
profile = 'black'
line_length = 100
Expand Down
101 changes: 2 additions & 99 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,101 +1,4 @@
"""Installation file for python pyvista module."""
from io import open as io_open
import os

"""See pyproject.toml for project metadata."""
from setuptools import setup

package_name = 'pyvista'

__version__ = None
filepath = os.path.dirname(__file__)
version_file = os.path.join(filepath, package_name, '_version.py')
with io_open(version_file, mode='r') as fd:
exec(fd.read())

install_requires = [
'numpy',
'imageio',
'pillow',
'pooch',
'scooby>=0.5.1',
'vtk',
"typing-extensions; python_version < '3.8'",
]

readme_file = os.path.join(filepath, 'README.rst')

setup(
name=package_name,
packages=[
'pyvista',
'pyvista.examples',
'pyvista.core',
'pyvista.core.filters',
'pyvista.demos',
'pyvista.jupyter',
'pyvista.plotting',
'pyvista.utilities',
'pyvista.ext',
],
version=__version__,
description='Easier Pythonic interface to VTK',
long_description=io_open(readme_file, encoding="utf-8").read(),
long_description_content_type='text/x-rst',
author='PyVista Developers',
author_email='[email protected]',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Information Analysis',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: MacOS',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
url='https://github.com/pyvista/pyvista',
keywords='vtk numpy plotting mesh',
package_data={
'pyvista': [
'py.typed',
],
'pyvista.examples': [
'airplane.ply',
'ant.ply',
'channels.vti',
'hexbeam.vtk',
'sphere.ply',
'nut.ply',
'uniform.vtk',
'rectilinear.vtk',
'globe.vtk',
'2k_earth_daymap.jpg',
],
},
project_urls={
"Documentation": "https://docs.pyvista.org/",
"Bug Tracker": "https://github.com/pyvista/pyvista/issues",
"Source Code": "https://github.com/pyvista/pyvista",
},
python_requires='>=3.7.*',
install_requires=install_requires,
extras_require={
'all': [
'matplotlib',
'colorcet',
'cmocean',
'meshio>=5.2',
'ipyvtklink',
'panel',
'pythreejs',
],
'colormaps': ['matplotlib', 'colorcet', 'cmocean'],
'io': ['meshio>=5.2'],
'jupyter': ['ipyvtklink', 'panel', 'pythreejs'],
},
zip_safe=False,
)
setup()

0 comments on commit 80185ea

Please sign in to comment.