Skip to content

Commit

Permalink
[SCSB-145] require Python 3.10 (#250)
Browse files Browse the repository at this point in the history
* require Python 3.10

* update references to Python 3.9

* oldest Numpy possible

* bump Scipy
  • Loading branch information
zacharyburnett authored Mar 18, 2024
1 parent cc054eb commit c43b9ef
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 135 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- linux: py39-oldestdeps-cov-xdist
- linux: py39-xdist
- linux: py310-oldestdeps-cov-xdist
- linux: py310-xdist
- linux: py311-xdist
- linux: py312-cov-xdist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- macos: py39-xdist
- macos: py310-xdist
- macos: py311-xdist
2 changes: 1 addition & 1 deletion .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- linux: py39-devdeps-xdist
- linux: py310-devdeps-xdist
- linux: py311-devdeps-xdist
- linux: py312-devdeps-xdist
- linux: py3-devdeps-xdist
test_downstream:
if: (github.repository == 'spacetelescope/stcal' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run devdeps tests')))
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ STScI Calibration algorithms and tools.

![STScI Logo](docs/_static/stsci_logo.png)

**STCAL requires Python 3.9 or above and a C compiler for dependencies.**
> [!IMPORTANT]
> STCAL requires Python 3.10 or above and a C compiler for dependencies.
**Linux and MacOS platforms are tested and supported. Windows is not currently supported.**
> [!IMPORTANT]
> Linux and MacOS platforms are tested and supported. Windows is not currently supported.**
**If installing on MacOS Mojave 10.14, you must install
into an environment with python 3.9. Installation will fail on python 3.10 due
to lack of a stable build for dependency `opencv-python`.**
> [!WARNING]
> Installation on MacOS Mojave 10.14 will fail due to lack of a stable build for dependency ``opencv-python``.
`STCAL` is intended to be used as a support package for calibration pipeline
software, such as the `JWST` and `Roman` calibration pipelines. `STCAL` is a
Expand Down
259 changes: 133 additions & 126 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,92 +1,100 @@
[project]
name = 'stcal'
description = 'STScI tools and algorithms used in calibration pipelines'
readme = 'README.md'
requires-python = '>=3.9'
license = { file = 'LICENSE' }
authors = [{ name = 'STScI', email = '[email protected]' }]
name = "stcal"
description = "STScI tools and algorithms used in calibration pipelines"
readme = "README.md"
requires-python = ">=3.10"
authors = [
{ name = "STScI", email = "[email protected]" },
]
classifiers = [
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
]
dependencies = [
'astropy >=5.0.4',
'scipy >=1.6.0',
'numpy >=1.20',
'opencv-python-headless >=4.6.0.66',
'asdf >=2.15.0',
'gwcs >= 0.18.1',
"astropy >=5.0.4",
"scipy >=1.7.2",
"numpy >=1.21.2",
"opencv-python-headless >=4.6.0.66",
"asdf >=2.15.0",
"gwcs >= 0.18.1",
]
dynamic = [
"version",
]
dynamic = ['version']

[project.license]
file = "LICENSE"

[project.optional-dependencies]
docs = [
'numpydoc',
'packaging >=17',
'sphinx<7.0.0',
'sphinx-asdf',
'sphinx-astropy',
'sphinx-rtd-theme',
'stsci-rtd-theme',
'tomli; python_version <="3.11"',
"numpydoc",
"packaging >=17",
"sphinx<7.0.0",
"sphinx-asdf",
"sphinx-astropy",
"sphinx-rtd-theme",
"stsci-rtd-theme",
"tomli; python_version <=\"3.11\"",
]
test = [
'psutil',
'pytest >=6',
'pytest-cov',
'pytest-doctestplus',
"psutil",
"pytest >=6",
"pytest-cov",
"pytest-doctestplus",
]

[project.urls]
'repository' = 'https://github.com/spacetelescope/stcal'
'tracker' = 'https://github.com/spacetelescope/stcal/issues'
repository = "https://github.com/spacetelescope/stcal"
tracker = "https://github.com/spacetelescope/stcal/issues"

[build-system]
requires = [
'setuptools >=61',
'setuptools_scm[toml] >=3.4',
'Cython >=0.29.21',
'numpy >=1.18',
"setuptools >=61",
"setuptools_scm[toml] >=3.4",
"Cython >=0.29.21",
"numpy >=1.18",
]
build-backend = 'setuptools.build_meta'
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = 'src/stcal/_version.py'
write_to = "src/stcal/_version.py"

[tool.setuptools]
zip-safe = true

[tool.setuptools.packages.find]
where = ['src']
where = [
"src",
]

[tool.pytest.ini_options]
minversion = 6
log_cli_level = "INFO"
xfail_strict = true
doctest_plus = true
doctest_rst = true
text_file_format = 'rst'
text_file_format = "rst"
addopts = [
'--color=yes',
'--doctest-rst',
'-ra',
'--strict-config',
'--strict-markers',
"--color=yes",
"--doctest-rst",
"-ra",
"--strict-config",
"--strict-markers",
]
testpaths = [
"tests",
"src/stcal",
"docs",
]
norecursedirs = [
'benchmarks',
'.asv',
'.eggs',
'.tox',
'build',
'venv',
"benchmarks",
".asv",
".eggs",
".tox",
"build",
"venv",
]
filterwarnings = [
"error::ResourceWarning",
Expand All @@ -98,80 +106,75 @@ markers = [
[tool.ruff]
line-length = 110
src = [
'src',
'tests',
'docs',
"src",
"tests",
"docs",
]

[tool.ruff.lint]
extend-select = [
'F', # Pyflakes (part of default flake8)
'W', 'E', # pycodestyle (part of default flake8)
'I', # isort (import sorting)
# 'N', # pep8-naming
'D', # pydocstyle (docstring style guide)
'UP', # pyupgrade (upgrade code to modern python)
'YTT', # flake8-2020 (system version info)
'ANN', # flake8-annotations (best practices for type annotations)
'S', # flake8-bandit (security checks)
'BLE', # flake8-blind-except (prevent blind except statements)
'B', # flake8-bugbear (prevent common gotcha bugs)
'A', # flake8-builtins (prevent shadowing of builtins)
'C4', # flake8-comprehensions (best practices for comprehensions)
'T10', # flake8-debugger (prevent debugger statements in code)
'EM', # flake8-errormessages (best practices for error messages)
'FA', # flake8-future-annotations (correct usage future annotations)
'ISC', # flake8-implicit-str-concat (prevent implicit string concat)
'ICN', # flake8-import-conventions (enforce import conventions)
'G', # flake8-logging-format (best practices for logging)
'INP', # flake8-no-pep420 (prevent use of PEP420, i.e. implicit name spaces)
'PIE', # flake8-pie (misc suggested improvement linting)
# 'T20', # flake8-print (prevent print statements in code)
'PT', # flake8-pytest-style (best practices for pytest)
'Q', # flake8-quotes (best practices for quotes)
'RSE', # flake8-raise (best practices for raising exceptions)
'RET', # flake8-return (best practices for return statements)
'SLF', # flake8-self (prevent private member access)
'SLOT', # flake8-slots (require __slots__ for immutable classes)
'SIM', # flake8-simplify (suggest simplifications to code where possible)
'TID', # flake8-tidy-imports (prevent banned api and best import practices)
'TCH', # flake8-type-checking (move type checking imports into type checking blocks)
'INT', # flake8-gettext (when to use printf style strings)
# 'ARG', # flake8-unused-arguments (prevent unused arguments)
'PTH', # flake8-use-pathlib (prefer pathlib over os.path)
# 'ERA', # eradicate (remove commented out code)
'PGH', # pygrep (simple grep checks)
'PL', # pylint (general linting, flake8 alternative)
'TRY', # tryceratops (linting for try/except blocks)
'FLY', # flynt (f-string conversion where possible)
'NPY', # NumPy-specific checks (recommendations from NumPy)
'PERF', # Perflint (performance linting)
'LOG',
'RUF', # ruff specific checks
"F",
"W",
"E",
"I",
"D",
"UP",
"YTT",
"ANN",
"S",
"BLE",
"B",
"A",
"C4",
"T10",
"EM",
"FA",
"ISC",
"ICN",
"G",
"INP",
"PIE",
"PT",
"Q",
"RSE",
"RET",
"SLF",
"SLOT",
"SIM",
"TID",
"TCH",
"INT",
"PTH",
"PGH",
"PL",
"TRY",
"FLY",
"NPY",
"PERF",
"LOG",
"RUF",
]
ignore = [
'ISC001', # interferes with formatter
'PLR0912', # Too many branches
'PLR0913', # Too many arguments
'PLR0915', # Too many statements
'PLR2004', # Magic value used in comparison

# Pydocstyle (to fix over time
'D100', # Undocumented public module
'D101', # Undocumented public class
'D102', # Undocumented public method
'D103', # Undocumented public function
'D104', # Undocumented public package
'D205', # 1 blank line required between summary line and description
'D401', # First line of docstring should be in imperative mood
'D404', # First word of docstring should not be This
"ISC001",
"PLR0912",
"PLR0913",
"PLR0915",
"PLR2004",
"D100",
"D101",
"D102",
"D103",
"D104",
"D205",
"D401",
"D404",
]
exclude = [
'docs',
'build',
'dist',
'.tox',
'.eggs',
"docs",
"build",
"dist",
".tox",
".eggs",
]

[tool.ruff.lint.extend-per-file-ignores]
Expand All @@ -184,7 +187,7 @@ exclude = [
convention = "numpy"

[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true # Turn of annotation checking for fully untyped code
ignore-fully-untyped = true

[tool.cython-lint]
max-line-length = 110
Expand All @@ -195,20 +198,24 @@ filter_files = true
line_length = 110

[tool.codespell]
skip="*.pdf,*.fits,*.asdf,.tox,build,./tags,.git,docs/_build"
# ignore-words-list="""
# """
skip = "*.pdf,*.fits,*.asdf,.tox,build,./tags,.git,docs/_build"

[tool.repo-review]
ignore = [
"GH200", # Use dependabot
"PC140", # add MyPy to pre-commit
"PC901", # custom pre-comit.ci message
"MY100", # Use MyPy
"GH200",
"PC140",
"PC901",
"MY100",
]

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
archs = [
"x86_64",
"arm64",
]

[tool.cibuildwheel.linux]
archs = ["auto", "aarch64"]
archs = [
"auto",
"aarch64",
]

0 comments on commit c43b9ef

Please sign in to comment.