From 0b69bae1c6324d819570528eecaec1021cb28a38 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 15:05:03 +0100 Subject: [PATCH 1/4] Update pyproject.toml with Python versions --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2b16dc340..404805415 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Energy System Model" readme = "README.md" -requires-python = ">= 3.7" +requires-python = ">= 3.8, <3.10" keywords = ["energy", "modelling"] classifiers = [ "Development Status :: 3 - Alpha", From 4f384f67b02076309e92dda6bd2bc7195e86f2af Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Fri, 19 May 2023 13:38:33 +0100 Subject: [PATCH 2/4] Moved all that can be moved from setup.cfg to pyproject.toml. --- pyproject.toml | 125 ++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 114 -------------------------------------------- setup.py | 3 -- 3 files changed, 124 insertions(+), 118 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 5450808c2..2b16dc340 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,127 @@ requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] \ No newline at end of file +[project] +name = "MUSE" +authors = [ + {name = "Sustainable Gas Institute", email = "sgi@imperial.ac.uk"}, +] +description = "Energy System Model" +readme = "README.md" +requires-python = ">= 3.7" +keywords = ["energy", "modelling"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python :: 3.8", + "Intended Audience :: Science", + "Intended Audience :: Research", + "Intended Audience :: Economists", + "Intended Audience :: Energy Experts", + "Intended Audience :: Climate Mitigation Experts", + "Intended Audience :: Industry", +] +dependencies = [ + "numpy==1.23.0", + "scipy", + "pandas<=1.3", + "click", + "xarray==2022.3.0", + "bottleneck", + "coloredlogs", + "toml", + "xlrd==1.2.0", + "mypy-extensions", + "pypubsub", +] +dynamic = ["version"] + +[project.urls] +Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" + +[project.optional-dependencies] +all = ["MUSE[dev,doc,excel]"] +dev = [ + "pytest>4.0.2", + "flake8!=3.8.1,!=3.8.0,<4.0.0", + "black", + "pytest-flake8", + "IPython", + "jupyter", + "nbconvert", + "nbformat", + "mypy", + "numpy>=1.17", + "pytest-xdist", + "bump2version", +] +doc = [ + "sphinx==5.0.2", + "ipykernel", + "nbsphinx", + "myst-parser", + "sphinxcontrib-bibtex", + "ipython", + "pandoc", +] +excel = ["openpyxl"] +private_sgi_model = [ + "SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master", + "StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy", +] + +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +namespaces = false + +[tool.setuptools.package-data] +"*" = ["**/*.toml", "**/*.csv"] + +[tool.setuptools.dynamic] +version = {attr = "muse.VERSION"} + +[tool.setuptools_scm] + +[tool.pyls] +configurationsources = ['flake8'] + +[tool.aliases] +test = "pytest" + +[tool.pytest.ini_options] +testpaths = ["tests", "src/muse"] +addopts = "--doctest-modules --flake8 -rfE -n auto" +markers = [ + "sgidata: test that require legacy data", + "legacy: test that require legacy modules", + "regression: a regression test", + "notebook: a test which consist in running a jupyter notebook", +] + +[tool.pycodestyle] +max-line-length = "88" +ignore = ["E203", "W503"] + +[tool.mypy] +ignore_missing_imports = true +strict_optional = true +files = ["src/**/*.py", "tests/**/*.py"] + +[[tool.mypy.overrides]] +module = ["setup"] +ignore_errors = true + +[tool.isort] +line_length = 88 +multi_line_output = 3 +include_trailing_comma = true + +[tool.build_sphinx] +project = "'MUSE'" +version = "attr: muse.VERSION" +release = "attr: muse.VERSION" +source-dir = "docs" +build-dir = "docs/build" diff --git a/setup.cfg b/setup.cfg index 64ce969c7..9883457f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,104 +3,10 @@ current_version = "1.0" commit = True tag = True -[metadata] -name = MUSE -version = attr: src.muse.VERSION -description = Energy System Model -classifiers = - Development Status :: 3 - Alpha - Programming Language :: Python :: 3.8 - Intended Audience :: Science - Intended Audience :: Research - Intended Audience :: Economists - Intended Audience :: Energy Experts - Intended Audience :: Climate Mitigation Experts - Intended Audience :: Industry -keywords = ["energy", "modelling"] -author = Sustainable Gas Institute -author_email = sgi@imperial.ac.uk -url = http://www.sustainablegasinstitute.org/home/muse-energy-model/ - -[options] -python_requires = >= 3.7 -package_dir = - =src -packages = find: -include_package_data = True -install_requires = - numpy==1.23.0 - scipy - pandas<=1.3 - click - xarray==2022.3.0 - bottleneck - coloredlogs - toml - xlrd==1.2.0 - mypy-extensions - pypubsub - -[options.packages.find] -where = src - -[options.package_data] -* = **/*.toml, **/*.csv - -[options.extras_require] -all = - %(dev)s - %(doc)s - %(excel)s -dev = - pytest>4.0.2 - flake8!=3.8.1,!=3.8.0,<4.0.0 - black - pytest-flake8 - IPython - jupyter - nbconvert - nbformat - mypy - numpy>=1.17 - pytest-xdist - bump2version -doc = - sphinx==5.0.2 - ipykernel - nbsphinx - myst-parser - sphinxcontrib-bibtex - ipython - pandoc -excel = - openpyxl -private_sgi_model = - SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master - StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy - [bumpversion:file:src/muse/__init__.py] [bumpversion:file:docs/conf.py] -[pyls] -configurationSources = ['flake8'] - -[aliases] -test = pytest - -[tool:pytest] -testpaths = tests src/muse -addopts = --doctest-modules --flake8 -rfE -n auto -markers = - sgidata: test that require legacy data - legacy: test that require legacy modules - regression: a regression test - notebook: a test which consist in running a jupyter notebook - -[pycodestyle] -max-line-length = 88 -ignore = E203,W503 - [flake8] max-line-length = 88 exclude = @@ -109,23 +15,3 @@ exclude = build, __pycache__, ignore = E203,W503 - -[mypy] -ignore_missing_imports = True -strict_optional = True -files = src/**/*.py,tests/**/*.py - -[mypy-setup] -ignore_errors = True - -[isort] -line_length = 88 -multi_line_output = 3 -include_trailing_comma = true - -[build_sphinx] -project = 'MUSE' -version = attr: src.muse.VERSION -release = attr: src.muse.VERSION -source-dir = docs -build-dir = docs/build diff --git a/setup.py b/setup.py deleted file mode 100644 index b908cbe55..000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -import setuptools - -setuptools.setup() From 6dab36c9b884d5d32b3bca3f101d0521accdeef4 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 15:05:03 +0100 Subject: [PATCH 3/4] Update pyproject.toml with Python versions --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2b16dc340..404805415 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Energy System Model" readme = "README.md" -requires-python = ">= 3.7" +requires-python = ">= 3.8, <3.10" keywords = ["energy", "modelling"] classifiers = [ "Development Status :: 3 - Alpha", From f43e00b243dbed6d2a101fee79cbb450a15bb8ed Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Mon, 22 May 2023 21:19:05 +0100 Subject: [PATCH 4/4] Remove duplicate key declaration --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 99164d62f..7121c65a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,9 +36,6 @@ dependencies = [ ] dynamic = ["version"] -[project.urls] -Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" - [project.optional-dependencies] all = ["MUSE[dev,doc,excel]"] dev = [