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 22 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:pyproject.toml]

[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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ All contributors must agree to the Contributor Agreement ([ContributorAgreement.
* Use the [OneFlow](https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow) model of development:
- Both new features and bug fixes should be developed in branches based on `master`.
- Hotfixes (critical bugs that need to be released *fast*) should be developed in a branch based on the latest tagged release.
* Write code that is compatible with all supported versions of Python (listed in [setup.py](https://github.com/glotzerlab/signac/blob/master/setup.py)).
* Write code that is compatible with all supported versions of Python (listed in [pyproject.toml](https://github.com/glotzerlab/signac/blob/master/pyproject.toml)).
* Avoid introducing dependencies -- especially those that might be harder to install in high-performance computing environments.
* Create [unit tests](https://en.wikipedia.org/wiki/Unit_testing) and [integration tests](https://en.wikipedia.org/wiki/Integration_testing) that cover the common cases and the corner cases of the code.
* Preserve backwards-compatibility whenever possible, and make clear if something must change.
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Changed
- The ``calc_id`` function has been moved from the ``hashing`` module to the ``job`` module (#873).
- Tests are run with all warnings treated as errors (#871).
- The contents of the ``syncutil`` module have been moved into ``sync`` (#869).
- The project now leverages a fully pyproject.toml-driven build (#878).

Removed
+++++++
Expand Down
9 changes: 7 additions & 2 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@ Consider installing :ref:`optional dependencies <optional_dependencies>`.
Source Code Installation
========================

Alternatively you can clone the `git repository <https://github.com/glotzerlab/signac>`_ and execute the ``setup.py`` script to install the package.
Alternatively you can clone the `git repository <https://github.com/glotzerlab/signac>`_ and pip install it directly, or install directly from git.
vyasr marked this conversation as resolved.
Show resolved Hide resolved

.. code:: bash

# Option 1
git clone https://github.com/glotzerlab/signac.git
cd signac
python setup.py install --user
pip install .

# Option 2
pip install git+https://github.com/glotzerlab/signac.git


Consider installing :ref:`optional dependencies <optional_dependencies>`.

Expand Down
77 changes: 77 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# 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>=64.0.0"]

[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
packages = { find = { namespaces = false, exclude = ["tests*", "benchmarks*"] } }
vyasr marked this conversation as resolved.
Show resolved Hide resolved

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

[tool.pydocstyle]
convention = "numpy"
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.

4 changes: 4 additions & 0 deletions signac/_vendor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2022 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Vendored packages."""