Skip to content

Commit 254844d

Browse files
authored
Merge pull request #908 from pjonsson/migrate-to-pyproject
Convert setup.py to pyproject.toml
2 parents 7c13a9f + 5ccae18 commit 254844d

7 files changed

Lines changed: 152 additions & 139 deletions

File tree

‎.github/workflows/build-wheel.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
python-version: '3.11'
2020
- name: Install dependencies
2121
run: |
22-
python -m pip install --upgrade pip
23-
pip install wheel
24-
- name: Build bdist_wheel
25-
run: python setup.py bdist_wheel
22+
python3 -m pip install --upgrade pip
23+
python3 -m pip install build
24+
- name: Build wheel
25+
run: python3 -m build
2626
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2727
with:
2828
path: dist/*.whl

‎.github/workflows/unittests.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ name: Unit tests
33
on:
44
push:
55
paths:
6-
- 'setup.py'
76
- 'pyproject.toml'
87
- 'openeo/**'
98
- 'tests/**'
109
pull_request:
1110
paths:
12-
- 'setup.py'
1311
- 'pyproject.toml'
1412
- 'openeo/**'
1513
- 'tests/**'

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
- Convert setup.py to pyproject.toml ([#920](https://github.com/Open-EO/openeo-python-client/issues/920))
15+
1416
### Removed
1517

1618
### Fixed

‎MANIFEST.in‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include pyproject.toml
12
include openeo/extra/spectral_indices/resources/*.json
23
include openeo/extra/spectral_indices/resources/*/*.json
34
include openeo/extra/spectral_indices/resources/*/LICENSE*

‎docs/development.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Prerequisites
211211
Important files
212212
---------------
213213

214-
``setup.py``
214+
``pyproject.toml``
215215
describes the metadata of the package,
216216
like package name ``openeo`` and version
217217
(which is extracted from ``openeo/_version.py``).
@@ -289,7 +289,7 @@ we will use a concrete version ``0.8.0`` in the examples below.
289289
- *Or, if you know what you are doing* and you're sure you have a clean
290290
local checkout, you can also build it locally::
291291

292-
python setup.py bdist_wheel
292+
python -m build
293293

294294
This should create ``dist/openeo-0.8.0-py3-none-any.whl``
295295

‎pyproject.toml‎

Lines changed: 143 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,147 @@
1+
[build-system]
2+
# Setuptools 75 is the latest version that works with Python 3.8.
3+
requires = ["setuptools>=75"]
4+
build-backend = "setuptools.build_meta"
15

2-
#[build-system]
3-
#requires = ["setuptools"]
4-
#build-backend = "setuptools.build_meta"
6+
[project]
7+
name = "openeo"
8+
dynamic = ["version"]
9+
description = "Client API for openEO"
10+
readme = "README.md"
11+
license = { text = "Apache-2.0" }
12+
requires-python = ">=3.8"
13+
authors = [
14+
{ name = "Jeroen Dries", email = "jeroen.dries@vito.be" },
15+
]
16+
classifiers = [
17+
"Development Status :: 5 - Production/Stable",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Programming Language :: Python :: 3.14",
26+
]
27+
dependencies = [
28+
"deprecated>=1.2.12",
29+
# TODO #717 Simplify geopandas constraints when Python 3.8 support is dropped
30+
"geopandas", # Best-effort geopandas dependency for Python 3.8
31+
"geopandas>=0.14; python_version>='3.9'",
32+
"importlib_resources; python_version<'3.9'",
33+
"numpy>=1.17.0",
34+
"oschmod>=0.3.12; sys_platform == \"win32\"",
35+
"pandas>0.20.0,<3.0.0", # TODO pandas 3 compatibility https://github.com/Open-EO/openeo-python-client/issues/856
36+
# TODO #578: pystac 1.5.0 is highest version available for lowest Python
37+
# version we still support (3.7).
38+
"pystac>=1.5.0",
39+
"requests>=2.26.0",
40+
"shapely>=1.6.4",
41+
"urllib3>=1.9.0",
42+
"xarray>=0.12.3,<2025.01.2", # TODO #721 xarray non-nanosecond support
43+
]
44+
45+
[project.optional-dependencies]
46+
artifacts = [
47+
"boto3",
48+
"botocore",
49+
]
50+
dev = [
51+
"boto3",
52+
"boto3~=1.37.38; python_version<'3.9'", # Pin to speed up slow dependency resolution on Python 3.8.
53+
"botocore",
54+
"botocore~=1.37.38; python_version<'3.9'", # Pin to speed up slow dependency resolution on Python 3.8.
55+
"dirty_equals>=0.8.0",
56+
"flake8>=5.0.0",
57+
"httpretty>=1.1.4",
58+
"mock",
59+
"moto>=5.0.0",
60+
"moto~=5.0.28; python_version<'3.9'", # Pin to speed up slow dependency resolution on Python 3.8.
61+
"myst-parser",
62+
"netCDF4>=1.7.0",
63+
"pyarrow>=10.0.1",
64+
"pydata_sphinx_theme",
65+
"pyproj>=3.2.0", # Pyproj is an optional, best-effort runtime dependency
66+
"pystac-client>=0.7.5",
67+
"pytest>=4.5.0",
68+
"python-dateutil>=2.7.0",
69+
"requests-mock>=1.8.0",
70+
"sphinx",
71+
"sphinx-autodoc-annotation",
72+
"sphinx-autodoc-typehints >=2.2.3",
73+
"sphinx-copybutton",
74+
"time_machine>=2.13.0",
75+
"types-boto3-s3",
76+
"types-boto3-sts",
77+
"urllib3<2.3.0",
78+
]
79+
docs = [
80+
"myst-parser",
81+
"pydata_sphinx_theme",
82+
"sphinx",
83+
"sphinx-autodoc-annotation",
84+
"sphinx-autodoc-typehints >=2.2.3",
85+
"sphinx-copybutton",
86+
]
87+
jupyter = [
88+
"ipyleaflet>=0.17.0",
89+
"ipython",
90+
]
91+
localprocessing = [
92+
"openeo_pg_parser_networkx>=2023.5.1",
93+
"openeo_processes_dask[implementations]>=2023.7.1",
94+
"pyproj",
95+
"rioxarray>=0.13.0",
96+
]
97+
# Install oschmod even when platform is not Windows, e.g. for testing in CI.
98+
oschmod = [
99+
"oschmod>=0.3.12",
100+
]
101+
tests = [
102+
"boto3",
103+
"boto3~=1.37.38; python_version<'3.9'", # Pin to speed up slow dependency resolution on Python 3.8.
104+
"botocore",
105+
"botocore~=1.37.38; python_version<'3.9'", # Pin to speed up slow dependency resolution on Python 3.8.
106+
"dirty_equals>=0.8.0",
107+
"flake8>=5.0.0",
108+
"httpretty>=1.1.4",
109+
"mock",
110+
"moto>=5.0.0",
111+
# Some pins to speed up slow dependency resolution in Python 3.8 venvs
112+
"moto~=5.0.28; python_version<'3.9'", # Pin to speed up slow dependency resolution on Python 3.8.
113+
"netCDF4>=1.7.0",
114+
"pyarrow>=10.0.1", # For Parquet read/write support in pandas
115+
"pyproj>=3.2.0",
116+
"pystac-client>=0.7.5",
117+
"pytest>=4.5.0",
118+
"python-dateutil>=2.7.0",
119+
"requests-mock>=1.8.0",
120+
"time_machine>=2.13.0",
121+
# httpretty doesn't work properly with urllib3>=2.3.0. See #700 and
122+
# https://github.com/gabrielfalcao/HTTPretty/issues/484
123+
"urllib3<2.3.0",
124+
]
125+
126+
[project.scripts]
127+
openeo-auth = "openeo.rest.auth.cli:main"
128+
129+
[project.urls]
130+
"Bug Tracker" = "https://github.com/Open-EO/openeo-python-client/issues"
131+
Changelog = "https://github.com/Open-EO/openeo-python-client/blob/master/CHANGELOG.md"
132+
Documentation = "https://open-eo.github.io/openeo-python-client/"
133+
Homepage = "https://github.com/Open-EO/openeo-python-client"
134+
"Source Code" = "https://github.com/Open-EO/openeo-python-client"
135+
136+
[tool.setuptools.dynamic]
137+
version = {attr = "openeo._version.__version__"}
138+
139+
[tool.setuptools.packages.find]
140+
include = ["openeo*"]
141+
142+
[tool.uv]
143+
# Version constraints for optionals aren't solvable with older Python versions.
144+
environments = ["python_version >= '3.10'"]
5145

6146
[tool.black]
7147
line-length = 120

‎setup.py‎

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)