Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to a fully pyproject.toml based build #878

Merged
merged 25 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a0cbbee
Move pydocstyle config to pyproject.toml.
vyasr Dec 6, 2022
570d0ec
Move mypy config to pyproject.toml.
vyasr Dec 6, 2022
81182d8
Remove unnecessary metadata section, see https://stackoverflow.com/qu…
vyasr Dec 6, 2022
7b2ad86
Remove now unnecessary bdist_wheel section.
vyasr Dec 6, 2022
289466b
Move pytest configuration to pyproject.toml.
vyasr Dec 6, 2022
ce2022b
Move coverage config to pyproject.toml.
vyasr Dec 6, 2022
fb25718
Move flake8 and bumpversion configs to separate files.
vyasr Dec 8, 2022
a3be249
Move all project config to pyproject.toml.
vyasr Dec 8, 2022
6eb94df
Specify build backend.
vyasr Dec 8, 2022
28119dc
Remove TODO.
vyasr Dec 18, 2022
9e03309
Remove editable install in CI.
vyasr Dec 18, 2022
9996503
Revert "Remove editable install in CI."
vyasr Dec 18, 2022
40a8d21
Add minimum setuptools version.
vyasr Dec 18, 2022
bb9effa
Update changelog.
vyasr Dec 18, 2022
478e96a
Make sure namespace packages aren't installed and try again.
vyasr Dec 18, 2022
f7a3914
Explicitly disallow test installation and add an __init__.py for _ven…
vyasr Dec 18, 2022
1b994f0
Go back to an editable install for CI.
vyasr Dec 18, 2022
2af479c
Specify pydocstyle convention.
vyasr Dec 18, 2022
3653123
Convert keywords to a proper list.
vyasr Dec 18, 2022
de245b3
Remove zip-safe.
vyasr Dec 18, 2022
5933fdb
Point bumpversion to pyproject.toml.
vyasr Dec 18, 2022
14fc9d8
Update contributing docs.
vyasr Dec 18, 2022
d11b4f5
Apply suggestions from code review
vyasr Dec 20, 2022
f9e2bbb
Update pyproject.toml
vyasr Dec 20, 2022
03d35d5
Merge branch 'master' into feat/all_pyproject_build
b-butler Jan 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .bumpversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[bumpversion]
current_version = 1.8.0
commit = True
tag = False
message = Bump up to version {new_version}.

[bumpversion:file:setup.py]

[bumpversion:file:signac/version.py]

[bumpversion:file:doc/conf.py]

[bumpversion:file:CITATION.cff]

[bumpversion:file:.zenodo.json]
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 100
exclude = _vendor
select = E,F,W
ignore = E123,E126,E203,E226,E241,E704,W503,W504
2 changes: 1 addition & 1 deletion .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' && matrix.config.dependencies != 'minimal' }}
- name: Test with pytest
run: |
pytest --cov=signac --cov-config=setup.cfg --cov-report=xml tests/ -v
pytest --cov=signac --cov-config=pyproject.toml --cov-report=xml tests/ -v
- uses: codecov/codecov-action@v2
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ repos:
rev: 'v4.3.0'
hooks:
- id: end-of-file-fixer
exclude: 'setup.cfg'
- id: trailing-whitespace
exclude: 'setup.cfg'
- id: check-builtin-literals
- id: check-executables-have-shebangs
- id: check-json
Expand Down Expand Up @@ -45,6 +43,8 @@ repos:
^doc/|
^tests/|
)
additional_dependencies:
- toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a newer pydocstyle that doesn’t require this additional dependency to be specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not. I opened an issue about this a while ago but never received a response from the devs. Maybe worth another ping.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment linking to this issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- toml
- toml # See https://github.com/PyCQA/pydocstyle/issues/603

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.981'
hooks:
Expand Down
77 changes: 77 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
# Copyright (c) 2020 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setuptools >= 64 is required for editable installs (pip install -e) with pyproject.toml-only builds. I don't think we need to encode that requirement here, just wanted to mention it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is quite odd. I tried changing our CI to do a non-editable pip install of the package, and I started seeing failures in test_single_writer_multiple_reader_same_instance. Here's one such example. The problem seems isolated to specific combinations in the test matrix, so I suspect that the issue is in some invalid assumption of the test. It's completely unrelated to this PR's changes, so I just bumped the setuptools requirement to move forward and continue doing an editable install. Just wanted to document the issue here in case someone sees it elsewhere.


[project]
name = "signac"
version = "1.8.0"
description = "Manage large and heterogeneous data spaces on the file system."
readme = "README.md"
# Supported versions are determined according to NEP 29.
# https://numpy.org/neps/nep-0029-deprecation_policy.html
requires-python = ">=3.8"
license = { file = "LICENSE.txt" }
maintainers = [{ name = "signac Developers", email = "[email protected]" }]
authors = [{ name = "Carl Simon Adorf et al.", email = "[email protected]" }]
keywords = ["simulation database index collaboration workflow"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Topic :: Database",
"Topic :: Scientific/Engineering :: Physics",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
# Platform-independent file locking
"filelock>=3.0",
# Used for version parsing and comparison
"packaging>=15.0",
# Progress bars
"tqdm>=4.10.0",
]

[project.optional-dependencies]
h5 = ["h5py"]

[project.scripts]
signac = "signac.__main__:main"

[project.urls]
Homepage = "https://signac.io"
Documentation = "https://docs.signac.io"
Download = "https://pypi.org/project/signac/"
Source = "https://github.com/glotzerlab/signac"
Issues = "https://github.com/glotzerlab/signac/issues"

[tool.setuptools]
vyasr marked this conversation as resolved.
Show resolved Hide resolved
zip-safe = false
packages = { find = {} }

[tool.black]
target-version = ['py38']
include = '\.pyi?$'
Expand All @@ -19,3 +76,23 @@ force-exclude = '''
[tool.isort]
profile = 'black'
skip_glob = 'signac/_vendor/*'

[tool.pydocstyle]
match = "^((?!\\.sync-zenodo-metadata|setup).)*\\.py$"
match-dir = "^((?!\\.|tests|_vendor).)*$"
ignore-decorators = "deprecated"
add-ignore = "D105, D107, D203, D204, D213"

[tool.mypy]
ignore_missing_imports = true

[tool.pytest.ini_options]
xfail_strict = true
filterwarnings = "error"

[tool.coverage.run]
branch = true
concurrency = [ "thread" , "multiprocessing" ]
vyasr marked this conversation as resolved.
Show resolved Hide resolved
parallel = true
source = [ "signac" ]
omit = [ "*/signac/_vendor/*" ]
2 changes: 1 addition & 1 deletion requirements/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coverage==6.5.0
coverage[toml]==6.5.0
pytest==7.2.0
pytest-cov==4.0.0
pytest-xdist==3.0.2
48 changes: 0 additions & 48 deletions setup.cfg

This file was deleted.

66 changes: 0 additions & 66 deletions setup.py

This file was deleted.