-
Notifications
You must be signed in to change notification settings - Fork 17
Replace setup.py with pyproject.toml and other metadata changes
#3983
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
Open
je-cook
wants to merge
5
commits into
ukaea:main
Choose a base branch
from
je-cook:pyproject
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
90ff043
move to modern build system
je-cook 754ca39
remove references to requirements.txt
je-cook d7a4b45
forgot entry point
je-cook 6b48d4c
change setup.py to pyproject.toml
clmould 4bc6ca8
Restrict dependency installation to required deps
je-cook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,8 +21,7 @@ jobs: | |
| - name: Install PROCESS | ||
| # Editable install to match default install | ||
| run: | | ||
| pip install -e '.[test, examples]' | ||
| pip install -r requirements_dev.txt | ||
| pip install -e '.[test]' | ||
| - name: Run unit tests | ||
| run: | | ||
| pytest --cov=process tests/unit -v \ | ||
|
|
@@ -45,7 +44,6 @@ jobs: | |
| # Editable install to match default install | ||
| run: | | ||
| pip install -e '.[test]' | ||
| pip install -r requirements_dev.txt | ||
| - name: Install poppler | ||
| run: | | ||
| sudo apt update | ||
|
|
@@ -64,7 +62,6 @@ jobs: | |
| # Editable install to match default install | ||
| run: | | ||
| pip install -e '.[test, examples]' | ||
| pip install -r requirements_dev.txt | ||
| - name: Install poppler | ||
| run: | | ||
| sudo apt update | ||
|
|
@@ -92,7 +89,6 @@ jobs: | |
| # Editable install to match default install | ||
| run: | | ||
| pip install -e '.[test]' | ||
| pip install -r requirements_dev.txt | ||
| - name: Allow git commands to be run | ||
| run: git config --global --add safe.directory '*' | ||
| - name: Run regression tests | ||
|
|
@@ -107,9 +103,7 @@ jobs: | |
| with: | ||
| python-version: '3.10' | ||
| - name: Install PROCESS | ||
| run: pip install -e . | ||
| - name: Install dev dependencies | ||
| run: pip install -r requirements_dev.txt | ||
| run: pip install -e '.[lint, docs, test]' | ||
| - name: Run regression input files | ||
| run: python tracking/run_tracking_inputs.py run tests/regression/input_files | ||
| - name: Move other files | ||
|
|
@@ -133,7 +127,7 @@ jobs: | |
| with: | ||
| python-version: '3.10' | ||
| - name: Install dev dependencies | ||
| run: pip install -r requirements_dev.txt | ||
| run: pip install '.[lint]' | ||
| - name: Run pre-commit | ||
| run: pre-commit run --all-files | ||
|
|
||
|
|
@@ -152,9 +146,7 @@ jobs: | |
| with: | ||
| python-version: '3.10' | ||
| - name: Install PROCESS | ||
| run: pip install -e . | ||
| - name: Install dev dependencies | ||
| run: pip install -r requirements_dev.txt | ||
| run: pip install -e '.[test, docs, lint]' | ||
| - name: Setup SSH identity | ||
| uses: webfactory/[email protected] | ||
| with: | ||
|
|
@@ -205,9 +197,7 @@ jobs: | |
| with: | ||
| python-version: '3.10' | ||
| - name: Install PROCESS | ||
| run: pip install -e . | ||
| - name: Install dev dependencies | ||
| run: pip install -r requirements_dev.txt | ||
| run: pip install -e '.[test, lint, docs]' | ||
| - run: python scripts/vardes.py | ||
| - run: git config --global --add safe.directory '*' | ||
| - name: Download STF_TF.json files | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,3 +65,4 @@ env-fork | |
| !tests/integration/data/large_tokamak_SIG_TF.json | ||
| *.html | ||
| !documentation/**/*.html | ||
| process/_version.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| from . import ( | ||
| from process.data_structure import ( | ||
| blanket_library, | ||
| build_variables, | ||
| buildings_variables, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,220 @@ | ||
| [build-system] | ||
| requires = ["hatchling", "hatch-vcs"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.hatch.version] | ||
| source = "vcs" | ||
| fallback-version = "0.0.0" | ||
|
|
||
| [tool.hatch.build.hooks.vcs] | ||
| version-file = "process/_version.py" | ||
|
|
||
| [project] | ||
| name = "process" | ||
| authors = [{ name = "UKAEA" }] | ||
| description = "Power Reactor Optimisation Code for Environmental and Safety Studies" | ||
| readme = "README.md" | ||
| requires-python = ">=3.10" | ||
| license = "MIT" | ||
| dynamic = ["version"] | ||
| dependencies = [ | ||
| "numpy>=1.23", | ||
| "scipy>=1.10", | ||
| "cvxpy~=1.7.3", | ||
| "osqp>=1.0", | ||
| "pandas>=2.0", | ||
| "numba>=0.57", | ||
| "PyVMCON>=2.4.0,<2.5.0", | ||
| "CoolProp>=6.4", | ||
| "matplotlib>=2.1.1", | ||
| "seaborn>=0.12.2", | ||
| "tabulate", | ||
| ] | ||
| keywords = ['fusion', 'optimisation'] | ||
| classifiers = [ | ||
| "Programming Language :: Python", | ||
| "Development Status :: 4 - Beta", | ||
| "Natural Language :: English", | ||
| "Intended Audience :: Science/Research", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: OS Independent", | ||
| "Topic :: Software Development :: Libraries :: Python Modules", | ||
| "Topic :: Scientific/Engineering :: Physics", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://www.ukaea.org/service/process/" | ||
| Source = "https://github.com/ukaea/process" | ||
| Documentation = "https://ukaea.github.io/PROCESS" | ||
| Issues = "https://github.com/ukaea/process/issues" | ||
|
|
||
| [project.optional-dependencies] | ||
| test = [ | ||
| "pytest>=5.4.1", | ||
| "requests>=2.30", | ||
| "testbook>=0.4", | ||
| "pytest-cov>=3.0.0", | ||
| "pytest-xdist>=2.5.0" | ||
| ] | ||
| examples = ["jupyter==1.0.0"] | ||
| plotly = ["plotly>=5.15.0,<6"] | ||
| docs = [ | ||
| "mkdocs>=1.1", | ||
| "mkdocs-material>=4.6.3", | ||
| "mkdocs-git-revision-date-localized-plugin >= 1.2", | ||
| "mkdocs-glightbox >= 0.3.4", | ||
| "pymdown-extensions>=6.3", | ||
| "bokeh>=3.4.0,<4", | ||
| "mkdocstrings==0.18.0", | ||
| "Jinja2>=3.0", | ||
| "mkdocs-jupyter>=0.24", | ||
| ] | ||
| lint = ["pre-commit>=2.16.0", "ruff==0.9.3", "ty"] | ||
| all = ["process[test,docs,lint,examples,plotly]"] | ||
|
|
||
| [project.scripts] | ||
| process = "process.main:main" | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| artifacts = [ | ||
| "process/data/lz_non_corona_14_elements/*.dat", | ||
| "process/io/*.png" | ||
| ] | ||
|
|
||
| [tool.hatch.envs.default] | ||
| features = ["dev", "test", "docs", "lint"] | ||
|
|
||
| [tool.hatch.envs.test] | ||
| features = ["test"] | ||
| [[tool.hatch.envs.test.matrix]] | ||
| python = ["3.10", "3.11", "3.12", "3.13"] | ||
| [tool.hatch.envs.test.scripts] | ||
| tests = "pytest {args:tests}" | ||
| tests-cov = "pytest --cov process --cov-report html:htmlcov --cov-report xml {args:tests}" | ||
| tests-cov-private = "pytest --private --cov process --cov-report html:htmlcov --cov-report xml {args:tests}" | ||
|
|
||
| [tool.hatch.envs.docs] | ||
| features = ["docs"] | ||
| [tool.hatch.envs.docs.scripts] | ||
| build = "mkdocs build" | ||
| serve = "mkdocs serve" | ||
| deploy = "mkdocs gh-deploy" | ||
|
|
||
| [tool.hatch.envs.lint] | ||
| detached = true # Don't inherit from default (does not download project dependencies) | ||
| dependencies = ["pre-commit", "ruff", "ty"] | ||
|
|
||
| [tool.hatch.envs.lint.scripts] | ||
| fmt = ["pre-commit run --all-files --hook-stage manual"] | ||
|
|
||
| [tool.coverage.report] | ||
| exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] | ||
| "omit" = ["process/_version.py"] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| addopts = "--strict-markers -r fEX" | ||
|
|
||
| [tool.ty.terminal] | ||
| output-format = "concise" | ||
|
|
||
| [tool.ruff] | ||
| target-version = "py310" | ||
| line-length = 88 | ||
| output-format = "concise" | ||
| extend-exclude = ["env", ".env"] | ||
|
|
||
| [tool.ruff.format] | ||
| preview = true | ||
|
|
||
| [tool.ruff.lint.per-file-ignores] | ||
| # Tests can use magic values, assertions, and relative imports | ||
| "tests/**" = ["ARG"] | ||
|
|
||
| [tool.ruff.lint.isort] | ||
| known-first-party = ["process"] | ||
|
|
||
| [tool.ruff.lint.flake8-tidy-imports] | ||
| ban-relative-imports = "all" | ||
|
|
||
| [tool.ruff.lint.pydocstyle] | ||
| convention = "numpy" | ||
|
|
||
| [tool.ruff.lint.flake8-copyright] | ||
| notice-rgx = "(?i)# SPDX-FileCopyrightText:\\s\\d{4}(-(\\d{4}|present))*" | ||
|
|
||
| [tool.ruff.lint.mccabe] | ||
| max-complexity = 12 | ||
|
|
||
| [tool.ruff.lint.pylint] | ||
| # These should be made stricter | ||
| max-args = 17 | ||
| max-locals = 17 | ||
|
|
||
| [tool.ruff.lint] | ||
| preview = false | ||
| extend-select = [ | ||
| "A", | ||
| "ARG", | ||
| "ASYNC", | ||
| "B", | ||
| "BLE", | ||
| "C4", | ||
| "COM", | ||
| "DTZ", | ||
| "EXE", | ||
| "F", | ||
| "FA", | ||
| "FLY", | ||
| "FURB", | ||
| "G", | ||
| "I", | ||
| "ICN", | ||
| "INT", | ||
| "ISC", | ||
| "LOG", | ||
| "N", | ||
| "NPY", | ||
| "PD", | ||
| "PERF", | ||
| "PGH", | ||
| "PIE", | ||
| "PYI", | ||
| "Q", | ||
| "RET", | ||
| "RSE", | ||
| "RUF", | ||
| "SIM", | ||
| "SLF", | ||
| "SLOT", | ||
| "T10", | ||
| "TID", | ||
| "UP", | ||
| "W", | ||
| "YTT", | ||
| ] | ||
| ignore = ["COM812", "FBT", "G004", "PD901"] | ||
|
|
||
| [tool.ruff.lint.pep8-naming] | ||
| ignore-names = [ | ||
| "*PROCESS*", | ||
| "*Bt*", | ||
| "*Bp*", | ||
| "*keV*", | ||
| "*MPa*", | ||
| "*H*", | ||
| "*T*", | ||
| "*D*", | ||
| "*He*", | ||
| "*Be*", | ||
| "C", | ||
| "N", | ||
| "O", | ||
| "Ne", | ||
| "Si", | ||
| "Ar", | ||
| "Fe", | ||
| "Ni", | ||
| "Kr", | ||
| "Xe", | ||
| "W", | ||
| ] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some new issues should be created from this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I recommend https://github.com/Fusion-Power-Plant-Framework/fppf-actions or modifications to it to unite our CI