Skip to content

Commit

Permalink
Transition to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Nov 13, 2024
1 parent bd60840 commit aba82f9
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 136 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,34 @@ jobs:
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}

- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}

- uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/*requirements.txt') }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy wheel
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install build
pip install .[development]
# Note the use of the -Wa flag to show DeprecationWarnings
- name: Unit tests
- name: Unit tests and doctests
run: |
python setup.py install
cd ~
python -Wa -m pytest --pyargs iris
python -Wa -m pytest
- name: Build documentation
run: |
python setup.py build_sphinx
- name: Doctests
run: |
python -m sphinx -b doctest docs build
run:
sphinx-build -M html docs build/docs


release:
Expand All @@ -86,8 +79,8 @@ jobs:

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install build
pip install .[development]
- name: Create release description
run: |
Expand All @@ -96,7 +89,7 @@ jobs:
- name: Create source distribution
run: |
python setup.py sdist
python -m build
- name: Create release
uses: softprops/action-gh-release@v2
Expand Down
6 changes: 4 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ build:

python:
install:
- requirements: requirements.txt
- requirements: dev-requirements.txt
- method: pip
path: .
extra_requirements:
- development
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
include README.md
include CHANGELOG.rst
include LICENSE.txt
include requirements.txt
include dev-requirements.txt
include iris_screen.png

recursive-exclude docs *
Expand Down
12 changes: 0 additions & 12 deletions dev-requirements.txt

This file was deleted.

81 changes: 81 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,88 @@
[build-system]
requires = ["build", "setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["iris"]

[tool.setuptools.dynamic]
version = {attr = "iris.__version__"}

[project]
name = "iris-ued"
dynamic = ["version"]
authors = [
{ name="Laurent P. René de Cotret", email="[email protected]" },
]
maintainers = [
{ name="Laurent P. René de Cotret", email="[email protected]" },
]
description = "Ultrafast electron diffraction data exploration"
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.7, <4"
dependencies = [
"numpy >= 1.22,< 3",
"scipy >= 1.0.0",
"h5py >= 2.10.0, < 4",
"PyQt5 >=5.15, <6",
"crystals >= 1.3.0, < 2",
"scikit-ued >= 2.1.4, < 3",
"qdarkstyle >= 2.8, < 3",
"pyqtgraph >= 0.11",
"npstreams >= 1.6.5, < 2",
"packaging >= 20",
]
keywords=["crystallography", "material science", "structural biology"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Visualization",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
]

[project.optional-dependencies]
development = [
"Sphinx >= 3",
"sphinx_rtd_theme >= 0.4",
"pytest >= 6",
"black",
"isort",
]

[project.urls]
Documentation = "https://iris-ued.readthedocs.io/"
Repository = "https://github.com/LaurentRDC/iris-ued"
"Bug Tracker" = "https://github.com/LaurentRDC/iris-ued/issues"

[project.scripts]
iris-cli = "iris.__main__:main"

[tool.black]
line-length = 120
include = '\.pyi?$'

[tool.isort]
profile = "black"
src_paths = ["iris/**/*.py"]

[tool.pytest.ini_options]
minversion = "6.0"
log_cli_level = "INFO"
# Very cool ability for pytest to also run doctests on package contents with `-doctest-modules`
addopts = [
"--doctest-modules",
"--ignore=iris/tests/broken_plugin.py",
]
testpaths = ["iris/tests"]
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

9 changes: 0 additions & 9 deletions setup.cfg

This file was deleted.

82 changes: 0 additions & 82 deletions setup.py

This file was deleted.

0 comments on commit aba82f9

Please sign in to comment.