From c503578c95651efb4d5802797982dad7c70090c2 Mon Sep 17 00:00:00 2001 From: Vikram Pande Date: Tue, 10 Sep 2024 13:53:00 +1000 Subject: [PATCH] Migration to pyproject.toml --- .readthedocs.yml | 3 ++- pyproject.toml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 8 ------- setup.py | 24 ------------------- 4 files changed, 62 insertions(+), 33 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.readthedocs.yml b/.readthedocs.yml index c99dff2..b4bd9b5 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,4 +5,5 @@ python: install: - method: pip path: . - - requirements: docs/requirements.txt + - method: pip + command: install -e .[docs] # Change to use pyproject.toml and set to editable mode so changes to source code can reflect without need to reinstall diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7128e47 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "ocf_data_sampler" +version = "0.0.16" +license = { file = "LICENSE" } +readme = "README.md" +description = "Sample from weather data for renewable energy prediction" +authors = [ + {name = "James Fulton, Peter Dudfield, and the Open Climate Fix team"}, + {email = "info@openclimatefix.org"} +] + +maintainers = [ + {name="Open Climate Fix Ltd"} +] + +dependencies = [ # Migration from requirements.txt + "numpy", + "pandas", + "xarray", + "zarr", + "dask", + "ocf_blosc2", + "ocf_datapipes==3.3.39", + "pvlib" +] + +keywords = [ # I've added some keywords, but please provide feedback if you'd like them changed! + "weather data", + "renewable energy prediction", + "sample weather data" +] + +classifiers = [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.8", # Sourced from .readthedocs.yml (please advise if this is wrong!) + "Operating System :: POSIX :: Linux", # Sourced from .github/workflows/workflows.yaml +] +requires-python = ">=3.8" + +[project.optional-dependencies] +docs = [ + "mkdocs>=1.2", + "mkdocs-material>=8.0" +] + +[project.urls] +homepage = "https://github.com/openclimatefix" +repository = "https://github.com/openclimatefix/ocf-data-sampler" + +[tool.setuptools] +packages = { find = {} } # Replaces the find_packages() in the setup.py +include-package-data = true + +[tool.ruff] +line-length = 100 +exclude = ["tests","data","scripts"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f33803c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -numpy -pandas -xarray -zarr -dask -ocf_blosc2 -ocf_datapipes==3.3.39 -pvlib \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index f2d954e..0000000 --- a/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -""" Usual setup file for package """ -# read the contents of your README file -from pathlib import Path - -from setuptools import find_packages, setup - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() -install_requires = (this_directory / "requirements.txt").read_text().splitlines() - -setup( - name="ocf_data_sampler", - version="0.0.16", - license="MIT", - description="Sample from weather data for renewable energy prediction", - author="James Fulton, Peter Dudfield, and the Open Climate Fix team", - author_email="info@openclimatefix.org", - company="Open Climate Fix Ltd", - install_requires=install_requires, - long_description=long_description, - long_description_content_type="text/markdown", - include_package_data=True, - packages=find_packages(), -)