Skip to content

Commit 751b925

Browse files
committed
Convert setup.py to pyproject.toml
The same files are included before/after when doing "python3 -m build" on my machine. Fixes #920
1 parent db3bda9 commit 751b925

6 files changed

Lines changed: 146 additions & 138 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
pip install wheel
20-
- name: Build bdist_wheel
21-
run: python setup.py bdist_wheel
19+
pip install build wheel
20+
- name: Build wheel
21+
run: python3 -m build
2222
- uses: actions/upload-artifact@v4
2323
with:
2424
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/**'

‎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 -w
293293

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

‎pyproject.toml‎

Lines changed: 140 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,144 @@
1+
[build-system]
2+
requires = ["setuptools>=69"]
3+
build-backend = "setuptools.build_meta"
14

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

6143
[tool.black]
7144
line-length = 120

‎setup.py‎

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

0 commit comments

Comments
 (0)