Skip to content

Commit

Permalink
👷 Use hatch as build backend
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand committed Sep 8, 2023
1 parent 828231b commit f117a43
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 125 deletions.
Binary file not shown.
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
run: |
conda install -y pandoc
python -m pip install -U pip wheel
pip install .
python -m pip install -U -r docs/requirements.txt
pip install .[docs]
- name: Show installed dependencies
run: |
pip freeze
Expand All @@ -70,8 +69,7 @@ jobs:
run: |
conda install -y pandoc
python -m pip install -U pip wheel
pip install .
python -m pip install -U -r docs/requirements.txt
pip install .[docs]
- name: Show installed dependencies
run: |
pip freeze
Expand All @@ -98,7 +96,7 @@ jobs:
run: |
python -m pip install -U pip wheel
python -m pip install -U -e .
python -m pip install -r requirements_dev.txt
python -m pip install -r requirements_pinned.txt
- name: Run tests
run: |
py.test --nbval --cov=./ --cov-report term --cov-report xml --cov-config pyproject.toml tests
Expand All @@ -125,7 +123,7 @@ jobs:
run: |
python -m pip install -U pip wheel
python -m pip install -U -e .
python -m pip install -r requirements_dev.txt
python -m pip install -r requirements_pinned.txt
python -m pip install git+https://github.com/glotaran/pyglotaran
- name: Show installed dependencies
run: |
Expand All @@ -147,10 +145,9 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install -U pip wheel
python -m pip install -U hatch
- name: Build dist
run: |
python setup.py sdist bdist_wheel
run: hatch build

- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8.10
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ repos:
- id: rstcheck
additional_dependencies: [sphinx]
exclude: "^docs/_templates"
args: [--ignore-directives=autosummary]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
Expand Down
3 changes: 3 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[formatting]
align_comments = false
array_auto_collapse = false
4 changes: 2 additions & 2 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies:
# update outdated repo2docker version
- pip
- pip:
- -r ../requirements_dev.txt
- ..
- -r ../requirements_pinned.txt
- ..[]
16 changes: 0 additions & 16 deletions docs/requirements.txt

This file was deleted.

106 changes: 92 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,84 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling",
]

[project]
name = "pyglotaran-extras"
description = "Supplementary package for pyglotaran with (example) plotting code."
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "Joris Snellenburg", email = "j.snellenburg@gmail.com" }]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Physics",
]
dynamic = [
"version",
]
dependencies = [
"cycler>=0.10",
"matplotlib>=3.3",
"numpy<1.24,>=1.21.2",
"pyglotaran>=0.7",
"tabulate>=0.8.9",
"xarray>=2022.3",
]
[project.optional-dependencies]
dev = [
"pyglotaran_extras[docs,test]",
]
docs = [
"jupyterlab>=3",
"matplotlib>=3",
"myst-parser>=0.12",
"nbsphinx>=0.8.1", # notebook docs
"numpydoc>=0.8",
"Sphinx>=3.2",
"sphinx-copybutton>=0.3",
"sphinx-last-updated-by-git>=0.3",
"sphinx-rtd-theme>=1.2",
"sphinxcontrib-jquery>=4.1", # Needed for the search to work Ref.: https://github.com/readthedocs/sphinx_rtd_theme/issues/1434
]
test = [
"coverage[toml]",
"nbval>=0.9.6",
"pluggy>=0.7",
"pytest>=3.7.1",
"pytest-cov>=2.5.1",
"tox>=3.5.2",
]
[project.urls]
Changelog = "https://pyglotaran-extras.readthedocs.io/en/latest/changelog.html"
Documentation = "https://pyglotaran-extras.readthedocs.io"
"GloTarAn Ecosystem" = "https://glotaran.org"
Homepage = "https://github.com/glotaran/pyglotaran-extras"
Source = "https://github.com/glotaran/pyglotaran-extras"
Tracker = "https://github.com/glotaran/pyglotaran-extras/issues"

[tool.hatch.version]
path = "pyglotaran_extras/__init__.py"

[tool.hatch.build.targets.sdist]
include = ["/pyglotaran_extras"]

[tool.hatch.envs.default]
features = ["dev"]

[tool.black]
line-length = 99
target-version = ['py38']
target-version = ['py310']
exclude = '''
/(
\.eggs
Expand All @@ -19,34 +97,34 @@ exclude = '''
[tool.ruff]

select = [
"E", # pycodestyle
"W", # pycodestyle
"C", # mccabe
"F", # pyflakes
"UP", # pyupgrade
"D", # pydocstyle
"N", # pep8-naming
"E", # pycodestyle
"W", # pycodestyle
"C", # mccabe
"F", # pyflakes
"UP", # pyupgrade
"D", # pydocstyle
"N", # pep8-naming
"YTT", # flake8-2020
"BLE", # flake8-blind-except
# "FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"FA", # flake8-future-annotations
"EM", # flake8-errmsg
"FA", # flake8-future-annotations
"EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PD", # pandas-vet
"PD", # pandas-vet
"PGH", # pygrep-hooks
"NPY", # NumPy-specific
"RUF", # Ruff-specific
Expand Down
3 changes: 1 addition & 2 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ build:

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
path: .[docs]
27 changes: 0 additions & 27 deletions requirements_dev.txt

This file was deleted.

8 changes: 8 additions & 0 deletions requirements_pinned.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Runtime dependencies

cycler==0.11.0
matplotlib==3.7.2
numpy==1.24.4
pyglotaran==0.7.1
tabulate==0.9.0
xarray==2023.8.0
51 changes: 0 additions & 51 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ commands = pre-commit run --all

[testenv]
install_command = {envpython} -m pip install {opts} {packages}
deps = -r{toxinidir}/requirements_dev.txt
deps = -r{toxinidir}/requirements_pinned.txt
commands =
pytest --nbval --cov=pyglotaran_extras --cov-config {toxinidir}/pyproject.toml

0 comments on commit f117a43

Please sign in to comment.