Skip to content

Commit faf41e5

Browse files
authored
Merge pull request #992 from xcube-dev/konstntokas-xxx-update_to_pyproject_toml
Update to modern Python project setup (`setup.py` to `pyproject.toml`)
2 parents 6fb55f2 + 95e9cee commit faf41e5

File tree

6 files changed

+125
-139
lines changed

6 files changed

+125
-139
lines changed

.github/workflows/xcube_publish_pypi.yml

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
pip install build
3030
- name: Build package
3131
run: |
32-
# Usage is in setup.py since name "xcube" is already taken on PyPI
33-
export XCUBE_PYPI_NAME="xcube-core"
3432
python -m build
3533
- name: Publish to TestPyPI
3634
run: |

.github/workflows/xcube_workflow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
conda info
3838
conda list
39-
python setup.py develop
39+
pip install -e .
4040
# Run unittests
4141
- name: unittest-xcube
4242
shell: bash -l {0}

CHANGES.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@
9191
left sidebar on the [PyPI xcube-core](https://pypi.org/project/xcube-core/) webpage.
9292

9393
* Used [`pyupgrade`](https://github.com/asottile/pyupgrade) to automatically upgrade
94-
language syntax for Python versions >= 3.9.
94+
language syntax for Python versions >= 3.9.
95+
96+
* Migrated the xcube project setup from `setup.py` to the modern `pyproject.toml` format.
9597

9698
## Changes in 1.5.1
9799

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ build_script:
5353
- micromamba create --name xc --file $APPVEYOR_BUILD_FOLDER/environment.yml
5454
- micromamba activate xc
5555
- cd $APPVEYOR_BUILD_FOLDER
56-
- python setup.py install
56+
- pip install --no-deps .
5757

5858
# Make sure pytest is installed
5959
- micromamba install --yes --name xc --channel conda-forge pytest attrs

pyproject.toml

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
[build-system]
2+
requires = ["setuptools >= 61.2.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "xcube-core"
7+
dynamic = ["version", "readme"]
8+
authors = [
9+
{name = "xcube Development Team"}
10+
]
11+
description = """\
12+
xcube is a Python package for generating and exploiting
13+
data cubes powered by xarray, dask, and zarr.
14+
"""
15+
keywords = [
16+
"analysis ready data", "data science",
17+
"datacube", "xarray", "zarr"
18+
]
19+
license = {text = "MIT"}
20+
requires-python = ">=3.9"
21+
dependencies = [
22+
"botocore>=1.34.51",
23+
"cftime>=1.6.3",
24+
"click>=8.0",
25+
"cmocean>=2.0",
26+
"dask>=2021.6",
27+
"dask-image>=0.6",
28+
"deprecated>=1.2",
29+
"distributed>=2021.6",
30+
"fiona>=1.8",
31+
"fsspec>=2021.6",
32+
"gdal>=3.0",
33+
"geopandas>=0.8",
34+
"jdcal>=1.4",
35+
"jsonschema>=3.2",
36+
"mashumaro",
37+
"matplotlib>=3.8.3",
38+
"netcdf4>=1.5",
39+
"numba>=0.52",
40+
"numcodecs>=0.12.1",
41+
"numpy>=1.16",
42+
"pandas>=1.3",
43+
"pillow>=6.0",
44+
"pyjwt>=1.7",
45+
"pyproj>=3.0",
46+
"pyyaml>=5.4",
47+
"rasterio>=1.2",
48+
"requests>=2.25",
49+
"rfc3339-validator>=0.1",
50+
"rioxarray>=0.11",
51+
"s3fs>=2021.6",
52+
"setuptools>=41.0",
53+
"shapely>=1.6",
54+
"tornado>=6.0",
55+
"urllib3>=1.26",
56+
"xarray>=2022.6",
57+
"zarr>=2.11"
58+
]
59+
classifiers = [
60+
"Development Status :: 5 - Production/Stable",
61+
"Intended Audience :: Science/Research",
62+
"Intended Audience :: Developers",
63+
"License :: OSI Approved :: MIT License",
64+
"Programming Language :: Python :: 3",
65+
"Programming Language :: Python :: 3.9",
66+
"Programming Language :: Python :: 3.10",
67+
"Programming Language :: Python :: 3.11",
68+
"Programming Language :: Python :: 3.12",
69+
"Topic :: Software Development",
70+
"Topic :: Scientific/Engineering",
71+
"Typing :: Typed",
72+
"Operating System :: Microsoft :: Windows",
73+
"Operating System :: POSIX",
74+
"Operating System :: Unix",
75+
"Operating System :: MacOS",
76+
]
77+
78+
# entry point xcube's CLI
79+
[project.scripts]
80+
xcube = "xcube.cli.main:main"
81+
82+
# entry point xcube's default extensions
83+
[project.entry-points.xcube_plugins]
84+
xcube = "xcube.plugin:init_plugin"
85+
86+
[tool.setuptools.package-data]
87+
"xcube.webapi.meta" = [
88+
"data/openapi.html",
89+
]
90+
"xcube.webapi.viewer" = [
91+
"data/*", "data/**/*",
92+
]
93+
94+
[tool.setuptools.dynamic]
95+
version = {attr = "xcube.__version__"}
96+
readme = {file = "README.md", content-type = "text/markdown"}
97+
98+
[tool.setuptools.packages.find]
99+
exclude = [
100+
"test*",
101+
"doc*"
102+
]
103+
104+
[project.optional-dependencies]
105+
dev = [
106+
"flake8>=3.7",
107+
"moto>=4",
108+
"pytest>=4.4",
109+
"pytest-cov>=2.6",
110+
"requests-mock>=1.8",
111+
"werkzeug"
112+
]
113+
114+
[project.urls]
115+
Documentation = "https://xcube.readthedocs.io/en/latest/"
116+
Source = "https://github.com/xcube-dev/xcube"
117+
Download = "https://pypi.org/project/xcube-core/#files"
118+
Tracker = "https://github.com/xcube-dev/xcube/issues"
119+
"Release notes" = "https://github.com/xcube-dev/xcube/releases"
120+
Changelog = "https://github.com/xcube-dev/xcube/blob/main/CHANGES.md"

setup.py

-134
This file was deleted.

0 commit comments

Comments
 (0)