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

Replace setup.py with pyproject.toml #1670

Open
wants to merge 5 commits into
base: develop-1.9
Choose a base branch
from
Open
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
72 changes: 14 additions & 58 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,72 +15,28 @@ on:
- '!contrib/**'

jobs:
pylint:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
name: Pylint
steps:
- name: checkout git
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- name: run pylint
run: |
sudo apt-get remove python3-openssl
pip install --upgrade -e '.[test]'
pip install pylint>3.2
pylint -j 2 --reports no datacube

python-version: ["3.12"]
lint-command:
- "pylint --j 2 --reports no datacube"
- "--group types mypy datacube"
- "pycodestyle tests integration_tests examples --max-line-length 120"

mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
name: MyPy
name: Code Lint
steps:
- name: checkout git
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- name: run mypy
run: |
sudo apt-get remove python3-openssl
pip install --upgrade -e '.[types]'
mypy datacube


pycodestyle:
name: pycodestyle
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup conda
uses: s-weigand/setup-conda@v1
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- name: Run pycodestyle
version: 0.5.5
enable-cache: 'true'
cache-suffix: ${{ matrix.python-version }}
- name: Run ${{ matrix.lint-command }}
run: |
sudo apt-get remove python3-openssl
pip install --upgrade -e '.[test]'
pycodestyle tests integration_tests examples --max-line-length 120
uv run ${{ matrix.lint-command }}
1 change: 1 addition & 0 deletions docs/about/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ v1.9.next
* Fix broken documentation build (:pull:`1668`)
* Rename `DatasetType` to `Product` in all the tests (:pull:`1671`)
* Documentation updates for 1.9 release (:pull:`1664`)
* Move package metadata from `setup.py` to `pyproject.toml` (:pull:`1670`)

v1.9.0-rc11 (28th October 2024)
===============================
Expand Down
133 changes: 131 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,135 @@
# pyproject.toml
[project]
name = 'datacube'
dynamic = ['version']
requires-python = ">=3.10"
readme = "README.rst"
license = {text = "Apache License 2.0"}
description = "An analysis environment for satellite and other earth observation data"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Information Analysis",
]
dependencies = [
'affine',
'antimeridian',
'attrs>=18.1',
'pyproj>=2.5',
'shapely>=2.0',
'cachetools',
'click>=5.0',
'cloudpickle>=0.4',
'dask[array]<2024.11.0', # Dask versions from 2024.11 cause problems with numpy2
'distributed<2024.11.0',
'jsonschema>=4.18', # New reference resolution API
'numpy>=1.26.0',
'lark',
'pandas',
'python-dateutil',
'pyyaml',
'rasterio>=1.3.11', # Deleted Numpy version in 1.3.10
'ruamel.yaml',
'sqlalchemy>=2.0', # GeoAlchemy2 requires >=1.4.
'GeoAlchemy2',
"alembic",
'toolz',
'xarray>=0.9', # >0.9 fixes most problems with `crs` attributes being lost
'packaging',
'odc-geo>=0.4.8',
'deprecat',
]

[project.urls]
Homepage = "https://opendatacube.org/"
Documentation = "https://datacube-core.readthedocs.io/"
Source = "https://github.com/opendatacube/datacube-core/"
Issues = "https://github.com/opendatacube/datacube-core/issues"
Chat = "https://discord.com/invite/4hhBQVas5U"

[project.optional-dependencies]
performance = ['ciso8601', 'bottleneck']
distributed = ['distributed', 'dask[distributed]']
s3 = ['boto3', 'botocore']
cf = ['compliance-checker>=4.0.0']
netcdf = ['netcdf4']
postgres = ['psycopg2']

[dependency-groups]
dev = [
'hypothesis',
'pycodestyle',
'pylint',
'pytest',
'pytest-cov',
'pytest-timeout',
'pytest-httpserver',
'moto<5.0', # 5.0 will require changes to some tests.
]
types = [
"mypy",
"types-affine",
"types-cachetools",
"types-jsonschema",
"types-psutil",
"types-python-dateutil",
"types-PyYAML",
"types-redis",
"types-setuptools",
"boto3-stubs",
"botocore-stubs"
]
doc = [
'Sphinx',
'sphinx_autodoc_typehints', # Propagate mypy info into docs
'sphinx-click',
'recommonmark',
'autodocsumm',
'beautifulsoup4',
'nbsphinx',
'pydata-sphinx-theme==0.9.0',
]

[project.scripts]
datacube = 'datacube.scripts.cli_app:cli'
datacube-search = 'datacube.scripts.search_tool:cli'
datacube-worker = 'datacube.execution.worker:main'


[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
requires = ["setuptools>=69", "setuptools_scm[toml]>=3.4"]
# v61 Add support for pyproject.toml, and include-package-data defaults to try when using pyproject.toml
# v69 includes py.typed files by default
build-backend = "setuptools.build_meta"

[project.entry-points."datacube.plugins.io.read"]
netcdf = "datacube.drivers.netcdf.driver:reader_driver_init"

[project.entry-points."datacube.plugins.io.write"]
netcdf = 'datacube.drivers.netcdf.driver:writer_driver_init'

[project.entry-points."datacube.plugins.index"]
postgres = 'datacube.index.postgres.index:index_driver_init'
null = 'datacube.index.null.index:index_driver_init'
memory = 'datacube.index.memory.index:index_driver_init'
postgis = 'datacube.index.postgis.index:index_driver_init'

[tool.setuptools.packages.find]
exclude = ['integration_tests', 'tests', 'examples', 'docs']
include = ['datacube*']

[tool.setuptools_scm]
write_to = "datacube/_version.py"
6 changes: 0 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[aliases]
test=pytest

[bdist_wheel]
universal=1

[flake8]
max-line-length = 120
ignore =
Expand Down
Loading
Loading