Skip to content

Commit

Permalink
Revert "Move requirements into pyproject.toml"
Browse files Browse the repository at this point in the history
This reverts commit 93c8d5fd9b9ea48310990b51ec8ddbfe8033b034.
  • Loading branch information
lukeshingles committed Jan 4, 2025
1 parent bc26c17 commit 0b48eb1
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 104 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploypypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
cache: pip

- name: Install dependencies
run: |
python3 -m pip install uv
python3 -m uv pip install .[dev]
python3 -m uv pip install --upgrade setuptools setuptools_scm[toml] wheel twine build
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install --upgrade setuptools setuptools_scm[toml] wheel twine build
- name: Build
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/deploytestpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ jobs:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
cache: pip

- name: Install dependencies
run: |
python3 -m pip install uv
python3 -m uv pip install .[dev]
python3 -m uv pip install --upgrade setuptools setuptools_scm[toml] wheel twine build
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install --upgrade setuptools setuptools_scm[toml] wheel twine build
- name: Build
run: |
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip

- name: Install dependencies
run: |
python3 -m pip install uv
python3 -m uv pip install .[dev]
python3 -m pip install --upgrade pip wheel mypy
python3 -m pip install -r requirements.txt
- name: Run pre-commit
run: |
Expand All @@ -39,28 +39,31 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip

- name: Install dependencies
run: |
python3 -m pip install uv
python3 -m uv pip install .[dev]
python3 -m pip install --upgrade pip wheel mypy
python3 -m pip install -r requirements.txt
- name: Run Ruff
if: always()
uses: astral-sh/ruff-action@v2
with:
version: 0.8.1
args: check --exit-non-zero-on-fix --no-fix

- name: Run Ruff Format
if: always()
uses: astral-sh/ruff-action@v2
with:
version: 0.8.1
args: format --check

- name: Run mypy
run: mypy --install-types --non-interactive
run: |
mypy --install-types --non-interactive
3 changes: 2 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Install pynonthermal
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .[dev]
python3 -m pip install .
- name: Test with pytest
run: python3 -m pytest --cov=./ --cov-report=xml
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repos:
args: [--fix=lf]
- id: name-tests-test
args: [--pytest-test-first]
- id: requirements-txt-fixer
# - id: trailing-whitespace

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
Expand All @@ -31,21 +32,21 @@ repos:
- id: yamlfmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.8.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.8.0
hooks:
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [numpy, pandas]
additional_dependencies: [numpy, types-PyYAML, pandas>=2.0.3]
types: [python]
require_serial: true

Expand Down
147 changes: 63 additions & 84 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ build-backend = "setuptools.build_meta"

[project]
name = "pynonthermal"
authors = [{ name = "Luke J. Shingles", email = "[email protected]" }]
description = "A non-thermal electron deposition (Spencer-Fano equation) solver."
authors = [
{name = "Luke J. Shingles", email = "[email protected]"},
]
description="A non-thermal electron deposition (Spencer-Fano equation) solver."
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.10",
Expand All @@ -14,32 +16,10 @@ classifiers = [
"Programming Language :: Python :: 3.13",
"Intended Audience :: Science/Research",
]
dynamic = ["version"]
dynamic = ["version", "dependencies"]
requires-python = ">=3.10"
license = { file = "LICENSE" }
readme = { file = "README.md", content-type = 'text/markdown' }
dependencies = [
"artistools>=2024.07.04.2",
"matplotlib>=3.9.1",
"numpy>=1.19.4",
"pandas>=1.1",
"polars>=1.0.0",
"scipy>=1.5.4",
]

[project.optional-dependencies]
dev = [
"mypy[faster-cache]>=1.14.1",
"mypy>=1.14.1",
"pre-commit>=4.0.1",
"pytest>=6.2.2",
"pytest-codspeed>=2.2.1",
"pytest-cov>=2.10.1",
"pytest-runner>=5.2",
"pytest-xdist[psutil]>=3.6.1",
"ruff>=0.8.6",
"typeguard>=4.1.5",
]
readme = {file = "README.md", content-type='text/markdown'}

[project.urls]
Repository = "https://www.github.com/lukeshingles/pynonthermal/"
Expand All @@ -55,12 +35,12 @@ disallow_untyped_calls = false
disallow_untyped_defs = false
error_summary = true
enable_error_code = [
"comparison-overlap",
"ignore-without-code",
"redundant-expr",
"redundant-self",
"truthy-bool",
"unused-awaitable",
"comparison-overlap",
"ignore-without-code",
"redundant-expr",
"redundant-self",
"truthy-bool",
"unused-awaitable",
]
exclude = "(build)|(dist)|(tests)|(data)"
ignore_missing_imports = true
Expand All @@ -80,15 +60,8 @@ warn_unused_ignores = true

[tool.pyright]
deprecateTypingAliases = true
enableTypeIgnoreComments = false # leave these for mypy to interpret
exclude = [
'**/node_modules',
'**/__pycache__',
'**/.*',
'build',
'dist',
'target',
]
enableTypeIgnoreComments = false # leave these for mypy to interpret
exclude=['**/node_modules','**/__pycache__','**/.*', 'build', 'dist', 'target']
reportAttributeAccessIssue = false
reportCallIssue = true
reportMissingImports = false
Expand All @@ -111,63 +84,63 @@ show-fixes = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ARG001", # ignored because variables in df.eval() are not detected
"ARG001", # ignored because variables in df.eval() are not detected
"ANN",
"B005", # strip-with-multi-characters
"B007", # variable not used in loop body (but sometimes it is with DataFrame.eval)
"B905", # zip without explicit strict parameter
"C901", # complex-structure
"B005", # strip-with-multi-characters
"B007", # variable not used in loop body (but sometimes it is with DataFrame.eval)
"B905", # zip without explicit strict parameter
"C901", # complex-structure
"COM812", # missing-trailing-comma
"CPY001", # missing-copyright-notice
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D107", # undocumented-public-init
"D203", # one-blank-line-before-class
"D205", # blank-line-after-summary
"D213", # multi-line-summary-second-line
"D417", # undocumented-param
"E501", # Line too long
"E741", # mixed-case-variable-in-global-scope
"CPY001", # missing-copyright-notice
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D107", # undocumented-public-init
"D203", # one-blank-line-before-class
"D205", # blank-line-after-summary
"D213", # multi-line-summary-second-line
"D417", # undocumented-param
"E501", # Line too long
"E741", # mixed-case-variable-in-global-scope
"ERA001", # commented-out-code
"FBT",
"FIX002", # line contains TODO
"ISC001", # single-line-implicit-string-concatenation
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # non-lowercase-variable-in-function
"N816", # variable-name-too-short
"N999", # invalid-module-name
"PD901", # df is a bad variable name
"ISC001", # single-line-implicit-string-concatenation
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # non-lowercase-variable-in-function
"N816", # variable-name-too-short
"N999", # invalid-module-name
"PD901", # df is a bad variable name
"PERF203", # try-except-in-loop
"PLC0414", # useless-import-alias
#"PGH001", # No builtin `eval()` allowed
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PLW2901", # redefined-loop-name
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
"S101", # Use of assert detected
"S301", # suspicious-pickle-usage
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PLW2901", # redefined-loop-name
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
"S101", # Use of assert detected
"S301", # suspicious-pickle-usage
#"S307", # suspicious-eval-usage
"S311", # suspicious-non-cryptographic-random-usage
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
"SLF001", # private-member-access
"T201", # print found
"S311", # suspicious-non-cryptographic-random-usage
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
"SLF001", # private-member-access
"T201", # print found
"TD002", # missing-todo-author
"TD003", # missing-todo-link
]
fixable = ["ALL"]
unfixable = [
"COM812", # missing-trailing-comma
"ERA001", # commented-out-code (will just delete it!)
"F401", # unused-import
"F841", # unused-variable
"COM812", # missing-trailing-comma
"ERA001", # commented-out-code (will just delete it!)
"F401", # unused-import
"F841", # unused-variable
"SIM222", # expr-or-true
"SIM223", # expr-and-false
]
Expand All @@ -192,6 +165,12 @@ packages = ["pynonthermal"]
include-package-data = true
license-files = ["LICENSE"]

#[tool.setuptools.packages.find]
#where = ["."]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools_scm]
version_file = "_version.py"
local_scheme = "no-local-version"
Expand Down
14 changes: 14 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
artistools>=2024.07.04.2
matplotlib>=3.9.1
numpy>=1.19.4
pandas>=1.1
polars>=1.0.0
pytest>=6.2.2
pytest-codspeed>=2.2.1
pytest-cov>=2.10.1
pytest-runner>=5.2
pytest-xdist[psutil]>=3.6.1
PyYAML>=5.3.1
scipy>=1.5.4
typeguard>=4.1.5
wheel>=0.36

0 comments on commit 0b48eb1

Please sign in to comment.