From a91f28896a3bd62083d3ece1c651f57cd400bee0 Mon Sep 17 00:00:00 2001 From: Robert Farmer Date: Wed, 10 Jul 2024 21:03:01 +0100 Subject: [PATCH] Cleanup build files --- .github/workflows/test.yml | 30 +++++++++++++++---------- pyproject.toml | 45 +++++++++++++++++++++++++++++++++++--- requirements.txt | 5 ----- setup.cfg | 35 ----------------------------- setup.py | 3 +-- tox.ini | 6 ++--- 6 files changed, 64 insertions(+), 60 deletions(-) delete mode 100644 requirements.txt delete mode 100644 setup.cfg diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7aa399b..722253b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,17 +10,23 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10','3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10','3.11','3.12'] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: tox \ No newline at end of file + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build wheel pytest + + - name: Build + run: python -m pip install . + + - name: Test + run: python -m pytest -v \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f64aa55..5930fea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,50 @@ [build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] - -build-backend = "setuptools.build_meta" +requires = ["setuptools>=64", "wheel", "setuptools_scm[toml]>=7.1.0"] +# Python 3.7 doesnt go above 7.1.0 [tool.pytest.ini_options] testpaths = [ "tests", ] +addopts = "-s" [tool.setuptools_scm] + + +[project] +name = "mesaPlot" +authors = [ + {name="Robert Farmer", email="robert.j.farmer37@gmail.com"} +] +description = "Library for reading and plotting MESA data" +readme = "README.md" +requires-python = ">=3.7" +license = {text = "GPLv2+"} +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Astronomy", + "Intended Audience :: Science/Research", +] + + +dependencies = [ + "numpy", + "matplotlib", + "scipy", + "pandas", + "importlib_metadata" # Needed for python <3.8 +] + +dynamic = ["version"] + + +[project.optional-dependencies] +test = ['pytest', 'tox'] +dev = ['pre-commit','black'] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a1116ac..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -numpy -matplotlib -scipy -pandas -pytest diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 01074a1..0000000 --- a/setup.cfg +++ /dev/null @@ -1,35 +0,0 @@ -[metadata] -name = mesaPlot -description = Library for reading and plotting MESA data -long_description = file: README.md -long_description_content_type = text/markdown -author = Robert Farmer -author_email = robert.j.farmer37@gmail.com -license = GPLv2+ -platforms = unix, linux, osx, cygwin, win32 -url = https://github.com/rjfarmer/mesaPlot -classifiers = - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Scientific/Engineering :: Astronomy - Intended Audience :: Science/Research - -[options] -python_requires = >=3.7 -packages = find: -install_requires = - numpy - matplotlib - scipy - pandas - pytest - -[options.extras_require] -testing = - pytest>=6.0 - tox>=3.24 diff --git a/setup.py b/setup.py index f840852..ecd37c5 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ from setuptools import setup -if __name__ == "__main__": - setup() +setup() diff --git a/tox.ini b/tox.ini index 5c778c8..1e2ba22 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -minversion = 3.8.0 -envlist = py3{7,8,9,10,11} +minversion = 3.12.0 +envlist = py3{7,8,9,10,11,12} isolated_build = true [testenv] @@ -8,4 +8,4 @@ setenv = PYTHONPATH = {toxinidir} commands = pytest --basetemp={envtmpdir} -whitelist_externals = pytest \ No newline at end of file +allowlist_externals = pytest \ No newline at end of file