-
Notifications
You must be signed in to change notification settings - Fork 56
Use pyproject.toml instead of setup.py #501
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
Merged
+168
−211
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,7 @@ the library as an "editable link", then install the development dependencies: | |
| $ git clone [email protected]:your_user_name/pystac-client.git | ||
| $ cd pystac | ||
| $ pip install -e . | ||
| $ pip install -r requirements-dev.txt | ||
| $ pip install -e '.[dev]' | ||
| Testing | ||
| ^^^^^^^ | ||
|
|
@@ -102,7 +101,7 @@ Python documentation requirements via pip, then use the ``build-docs`` script: | |
|
|
||
| .. code-block:: bash | ||
| $ pip install -r requirements-docs.txt | ||
| $ pip install -e '.[docs]' | ||
| $ scripts/build-docs | ||
| CHANGELOG | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,5 +9,4 @@ dependencies: | |
| - python=3.9 | ||
| - pip | ||
| - pip: | ||
| - -r ../requirements-docs.txt | ||
| - -e ../ | ||
| - -e ../[docs] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,119 @@ | ||
| [tool.ruff] | ||
| ignore = [ | ||
| "E722", | ||
| "E731", | ||
| [project] | ||
| name = "pystac-client" | ||
| description = "Python library for working with SpatioTemporal Asset Catalog (STAC) APIs." | ||
| readme = "README.md" | ||
| authors = [ | ||
| { name = "Jon Duckworth", email = "[email protected]" }, | ||
| { name = "Matthew Hanson", email = "[email protected]" }, | ||
| ] | ||
| line-length = 88 | ||
| select = [ | ||
| "E", | ||
| "F", | ||
| "W", | ||
| maintainers = [{ name = "Pete Gadomski", email = "[email protected]" }] | ||
| keywords = ["pystac", "imagery", "raster", "catalog", "STAC"] | ||
| license = { text = "Apache-2.0" } | ||
| classifiers = [ | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Operating System :: OS Independent", | ||
| "Natural Language :: English", | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Topic :: Scientific/Engineering :: GIS", | ||
| "Topic :: Software Development :: Libraries", | ||
| "Topic :: Software Development :: Libraries :: Python Modules", | ||
| ] | ||
| requires-python = ">=3.8" | ||
| dependencies = [ | ||
| "requests>=2.28.2", | ||
| "pystac[validation]>=1.7.2", | ||
| "python-dateutil>=2.8.2", | ||
| ] | ||
| dynamic = ["version"] | ||
|
|
||
| [project.scripts] | ||
| stac-client = "pystac_client.cli:cli" | ||
|
|
||
| [project.optional-dependencies] | ||
| dev = [ | ||
| "black~=23.3.0", | ||
| "codespell~=2.2.4", | ||
| "coverage~=7.2", | ||
| "doc8~=1.1.1", | ||
| "importlib-metadata~=6.6.0", | ||
| "mypy~=1.2", | ||
| "orjson~=3.8", | ||
| "pre-commit~=3.2", | ||
| "pytest-benchmark~=4.0.0", | ||
| "pytest-console-scripts~=1.3.1", | ||
| "pytest-cov~=4.0.0", | ||
| "pytest-recording~=0.12.2", | ||
| "pytest~=7.3.1", | ||
| "recommonmark~=0.7.1", | ||
| "requests-mock~=1.10.0", | ||
| "ruff==0.0.263", | ||
| "tomli~=2.0; python_version<'3.11'", | ||
| "types-python-dateutil~=2.8.19", | ||
| "types-requests~=2.28.11", | ||
| ] | ||
| docs = [ | ||
| "Sphinx~=6.2", | ||
| "boto3~=1.26", | ||
| "geojson~=3.0.1", | ||
| "geopandas~=0.12.2", | ||
| "hvplot~=0.8.3", | ||
| "ipykernel~=6.22", | ||
| "ipython~=8.12", | ||
| "jinja2<4.0", | ||
| "matplotlib~=3.7.1", | ||
| "myst-parser~=1.0.0", | ||
| "nbsphinx~=0.9", | ||
| "pydata-sphinx-theme~=0.13", | ||
| "pygeoif~=1.0", | ||
| "sphinxcontrib-fulltoc~=1.2", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| homepage = "https://github.com/stac-utils/pystac-client" | ||
| documentation = "https://pystac-client.readthedocs.io" | ||
| repository = "https://github.com/stac-utils/pystac-client.git" | ||
| changelog = "https://github.com/stac-utils/pystac-client/blob/main/CHANGELOG.md" | ||
| discussions = "https://github.com/radiantearth/stac-spec/discussions/categories/stac-software" | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| include = ["pystac_client*"] | ||
| exclude = ["tests*"] | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| version = { attr = "pystac_client.version.__version__" } | ||
|
|
||
| [tool.doc8] | ||
| ignore-path = "docs/_build,docs/tutorials" | ||
| max-line-length = 130 | ||
|
|
||
| [tool.ruff] | ||
| ignore = ["E722", "E731"] | ||
| line-length = 88 | ||
| select = ["E", "F", "W"] | ||
|
|
||
| [tool.ruff.per-file-ignores] | ||
| "__init__.py" = ["F401"] | ||
| "test_item_search.py" = ["E501"] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| markers = "vcr: records network activity" | ||
| addopts = "--benchmark-skip -Werror --block-network" | ||
|
|
||
| [tool.mypy] | ||
| show_error_codes = true | ||
| strict = true | ||
|
|
||
| [[tool.mypy.overrides]] | ||
| module = ["jinja2"] | ||
| ignore_missing_imports = true | ||
|
|
||
| [build-system] | ||
| requires = ["setuptools>=61.0"] | ||
| build-backend = "setuptools.build_meta" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| """Installs the minimum version of all stactools dependencies, with pip. | ||
| Assumptions: | ||
| - You've installed the development dependencies: `pip install '.[dev]'` | ||
| - All of the dependencies in pyproject.toml are specified with `>=` | ||
| For more context on the approach and rationale behind testing against minimum | ||
| requirements, see | ||
| https://www.gadom.ski/2022/02/18/dependency-protection-with-python-and-github-actions.html. | ||
| """ | ||
|
|
||
| import subprocess | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| from packaging.requirements import Requirement | ||
|
|
||
| assert sys.version_info[0] == 3 | ||
| if sys.version_info[1] < 11: | ||
| import tomli as toml | ||
| else: | ||
| import tomllib as toml | ||
|
|
||
|
|
||
| root = Path(__file__).parents[1] | ||
| with open(root / "pyproject.toml", "rb") as f: | ||
| pyproject_toml = toml.load(f) | ||
| requirements = [] | ||
| for install_requires in filter( | ||
| bool, | ||
| (i.strip() for i in pyproject_toml["project"]["dependencies"]), | ||
| ): | ||
| requirement = Requirement(install_requires) | ||
| assert len(requirement.specifier) == 1 | ||
| specifier = list(requirement.specifier)[0] | ||
| assert specifier.operator == ">=" | ||
| install_requires = install_requires.replace(">=", "==") | ||
| requirements.append(install_requires) | ||
gadomski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| subprocess.run(["pip", "install", *requirements]) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.