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

Refactor python optional dependencies #268

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Setup spglib
# TODO: switch to editable installs
run: |
pip install .[testing] \
pip install .[test-cov] \
--config-settings=cmake.define.SPGLIB_TEST_COVERAGE=ON \
--config-settings=build-dir=build
- name: Test with pytest and code coverage
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python:
install:
- path: .
extra_requirements:
- doc
- docs
build:
os: ubuntu-22.04
tools:
Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This directory contains python-sphinx documentation source.
Python>=3.8 required for `importlib.metadata`.

```shell
$ pip install -e ".[doc]"
$ pip install -e ".[docs]"
$ cd doc
$ make html
$ sphinx-autobuild . _build
Expand Down
29 changes: 23 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,38 @@ repository = "https://github.com/spglib/spglib"
changelog = "https://spglib.readthedocs.io/en/latest/releases.html"

[project.optional-dependencies]
testing = [
test = [
"codecov",
"pytest",
"pytest-cov",
"pytest-benchmark",
"pyyaml",
]
doc = [
docs = [
"Sphinx==4.5.0",
"sphinx-autobuild==2021.3.14",
"sphinxcontrib-bibtex==2.4.2",
"sphinx-book-theme==0.3.3",
"myst-parser==0.18.0",
"linkify-it-py==2.0.0"
]
test-cov = [
"spglib[test]",
"pytest-cov",
]
test-benchmark = [
"spglib[test]",
"pytest-benchmark",
]
dev = [
"spglib[test]",
"pre-commit",
]
# Alternative names for compatibility
doc = [
"spglib[docs]",
]
testing = [
"spglib[test]",
]

[tool.scikit-build]
#wheel.packages = "python/spglib"
Expand All @@ -56,7 +73,7 @@ cmake.args = [

[tool.cibuildwheel]
skip = ["pp*", "*-win32", "*-manylinux_i686", "*-musllinux*", "*-macosx_arm64"]
test-extras = "testing"
test-extras = "test"
test-command = "pytest {package}/python/test --benchmark-skip"
# Do not run test on emulated environments
test-skip = "*-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64 *-macosx_universal2:arm64"
Expand All @@ -72,7 +89,7 @@ repair-wheel-command = ""
repair-wheel-command = ""

[tool.pytest.ini_options]
addopts = "--benchmark-skip"
addopts = "-m 'not benchmark'"
testpaths = ["python/test"]

[tool.coverage.run]
Expand Down
2 changes: 1 addition & 1 deletion python/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To include testing or documentation environments, simply include the relevant ex

.. code-block:: console

$ pip install .[testing,doc]
$ pip install .[test]

Running tests
~~~~~~~~~~~~~
Expand Down