Skip to content
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

Use SPEC0 versions; drop support for python 3.8, 3.9 #185

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ignore =
exclude =
hypnotoad/gui/hypnotoad_mainWindow.py,
hypnotoad/gui/hypnotoad_preferences.py,
hypnotoad/gui/__init__.py
hypnotoad/__version__.py
versioneer.py
hypnotoad/gui/__init__.py,
hypnotoad/__version__.py,
versioneer.py,
build,
.venv
46 changes: 22 additions & 24 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,21 @@ jobs:
if: always()
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
python-version: ['3.10', '3.11', '3.12']
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[tests]
- name: Test with pytest
run: |
pip install pytest
pytest
run: pytest


integrated-tests:
Expand All @@ -44,21 +42,21 @@ jobs:
if: always()
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
python-version: ['3.10', '3.11', '3.12']
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[tests]
- name: Integrated tests
run: |
pip install pytest xarray
Expand All @@ -75,13 +73,13 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -112,13 +110,13 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -153,15 +151,15 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Lint with flake8
run: |
pip install flake8
Expand All @@ -175,11 +173,11 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[tests]
- name: Test with pytest
run: |
pip install pytest
pytest


Expand All @@ -39,15 +38,15 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Lint with flake8
run: |
pip install flake8
Expand All @@ -60,11 +59,11 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -82,9 +81,9 @@ jobs:
needs: [pytest, flake8, black]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
131 changes: 128 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
.*.sw*
*.nc
__pycache__
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Other
.DS_Store
.idea/
*.sw[po]
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def create_options_rst(filename, title, options_factory, *, exclude=None):
"OptionsFactory constructors in the hypnotoad source code. To change the "
"formatting, edit the ``create_options_rst()`` function in ``conf.py``.\n\n"
)
f.write(f"{title}\n{'='*len(title)}\n\n")
f.write(f"{title}\n{'=' * len(title)}\n\n")
tt = options_factory.get_help_table(as_Texttable=True)
tt.set_cols_width([62, 80, 20])
f.write(".. table::\n :widths: 20 75 5\n\n")
Expand Down
4 changes: 2 additions & 2 deletions hypnotoad/core/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -4476,12 +4476,12 @@ def getSmoothMonotonicGridFunc(
"""
if grad_lower is not None and (upper - lower) * grad_lower < 0:
raise ValueError(
f"(upper-lower)={(upper-lower)} and grad_lower={grad_lower} have "
f"(upper-lower)={(upper - lower)} and grad_lower={grad_lower} have "
f"different signs: should both be increasing or both be decreasing."
)
if grad_upper is not None and (upper - lower) * grad_upper < 0:
raise ValueError(
f"(upper-lower)={(upper-lower)} and grad_upper={grad_upper} have "
f"(upper-lower)={(upper - lower)} and grad_upper={grad_upper} have "
f"different signs: should both be increasing or both be decreasing."
)

Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ classifiers = [
"Operating System :: OS Independent",
]

requires-python = ">=3.8"
requires-python = ">=3.10"
dependencies = [
"boututils~=0.1.7",
"dill~=0.3,!=0.3.5,!=0.3.5.1",
"func_timeout~=4.3",
"matplotlib~=3.2",
"matplotlib~=3.7",
"netCDF4~=1.5",
"numpy~=1.18",
"numpy~=1.24",
"optionsfactory~=1.0.11",
"PyYAML>=5.1",
"scipy~=1.6",
"scipy~=1.10",
"Qt.py~=1.2",
]

Expand All @@ -50,6 +50,7 @@ docs = [
]
tests = [
"pytest >= 3.3.0",
"xarray >= 2022.9.0",
]

[project.scripts]
Expand Down