From fba6366cb637108be618e2f1dbd0a9b00d65fda3 Mon Sep 17 00:00:00 2001 From: Allison Date: Fri, 7 Aug 2026 16:23:18 -0400 Subject: [PATCH] Changed to pyproject.toml --- .github/workflows/release.yml | 16 ++++------- pyproject.toml | 41 +++++++++++++++++++++++++++ requirements.txt | 7 ----- setup.py | 53 ----------------------------------- test_requirements.txt | 8 ------ 5 files changed, 46 insertions(+), 79 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py delete mode 100644 test_requirements.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c7117d..3d60d46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,10 +50,7 @@ jobs: - name: Install package from Test PyPi run: | python -m pip install --upgrade pip - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple leaflux - - name: Install test dependencies - run: | - pip install -r test_requirements.txt + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "leaflux[test]" - name: Run pytest env: TEST_ENV: test_pypi @@ -75,13 +72,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build twine - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* test-on-pypi: @@ -101,12 +98,9 @@ jobs: - name: Install package from PyPi run: | python -m pip install --upgrade pip - pip install leaflux - - name: Install test dependencies - run: | - pip install -r test_requirements.txt + pip install "leaflux[test]" - name: Run pytest env: TEST_ENV: pypi run: | - pytest + pytest \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3f6a84d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools>=77.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "leaflux" +version = "0.5.0" +description = "Core algorithms for the Leaflux project" +readme = "README.md" +license = "MIT" +license-files = ["LICENSE"] +requires-python = ">=3.9" +dependencies = [ + "numpy", + "pvlib", + "scipy", + "sparse", + "numba", + "pyvista", +] +classifiers = [ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering", +] + +[project.urls] +Homepage = "https://github.com/silvxlabs/leaflux-core" + +[project.optional-dependencies] +test = ["pytest"] + +[tool.setuptools.packages.find] +where = ["."] +exclude = ["docs", "test", "data"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a0ae1b3..0000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -numpy -datetime -pvlib -scipy -sparse -numba -pyvista \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 49b1c08..0000000 --- a/setup.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import annotations -import json -import urllib.request -from setuptools import find_packages, setup - - -def read_file(fname): - with open(fname, encoding="utf-8") as fd: - return fd.read() - - -def get_requirements(fname): - with open(fname, encoding="utf-8") as fd: - reqs = [line.strip() for line in fd if line] - return reqs - -NAME = "leaflux" -DESCRIPTION = "Core algorithms for the Leaflux project" -LONG_DESCRIPTION = read_file("README.md") -VERSION = "0.5.0" -LICENSE = "MIT" -URL = "https://github.com/silvxlabs/leaflux-core" -INSTALL_REQUIRES = [ - get_requirements("requirements.txt") -] - -setup( - name=NAME, - version=VERSION, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - license=LICENSE, - url=URL, - # project_urls=PROJECT_URLS, - classifiers=[ - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Scientific/Engineering", - ], - package_dir={"": "."}, - packages=find_packages(exclude=["docs", "tests", "data"]), - include_package_data=True, - install_requires=INSTALL_REQUIRES, - python_requires=">=3.9", -) \ No newline at end of file diff --git a/test_requirements.txt b/test_requirements.txt deleted file mode 100644 index 32720b6..0000000 --- a/test_requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -numpy -datetime -pvlib -scipy -sparse -numba -pyvista -pytest \ No newline at end of file