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

Chore/upgrade dependencies #188

Merged
merged 23 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b1d051f
docs: clarify styling comment
Flix6x Sep 19, 2024
49f9a01
feat: `make test` tests optional parts, too
Flix6x Sep 19, 2024
7bc7bc3
chore: add classifiers for Python 3.10 and 3.11
Flix6x Sep 19, 2024
dc15273
chore: move requirements to python-version-specific folder
Flix6x Sep 19, 2024
dc38874
feature: make command to upgrade deps
Flix6x Sep 19, 2024
8ded176
chore: missing commands from listing, and define commands in the same…
Flix6x Sep 19, 2024
99aaa26
feature: add requirements.txt for Python 3.11
Flix6x Sep 19, 2024
cdedef8
chore: update dev docs
Flix6x Sep 19, 2024
c735579
refactor: `make test` uses all tests straightaway
Flix6x Sep 19, 2024
7eae076
feature: ensure dependencies folder
Flix6x Sep 19, 2024
3ee98e1
fix: installation dependencies for all tests
Flix6x Sep 19, 2024
e19b802
docs: obsolete comment
Flix6x Sep 19, 2024
001e0b7
feature: allow skipping test when upgrading dependencies
Flix6x Sep 19, 2024
798cec5
refactor: move test dependencies to `make install-for-test`
Flix6x Sep 19, 2024
3d1adc6
feature: test the core with fewer pinned dependencies, and then test …
Flix6x Sep 19, 2024
5d5977a
chore: unpin numpy and scipy in optional forecast dependencies
Flix6x Sep 19, 2024
c574364
chore: unpin pandas for 3.11 and higher
Flix6x Sep 19, 2024
66b6c64
feature: automate test pipeline for Python 3.11
Flix6x Sep 19, 2024
d727aeb
fix: AttributeError: `np.NaN` was removed in the NumPy 2.0 release. U…
Flix6x Sep 19, 2024
cb0eb78
Revert "chore: unpin pandas for 3.11 and higher"
Flix6x Sep 19, 2024
5577fae
feature: automate test pipeline for Python 3.12 (#190)
Flix6x Sep 19, 2024
e9ffb4d
fix(deps): pin only from 3.11 onwards
Flix6x Sep 19, 2024
c4533b9
Revert "fix(deps): pin only from 3.11 onwards"
Flix6x Sep 19, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
py_version: [ '3.7', '3.8', '3.9', '3.10' ]
py_version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
include:
- py_version: '3.7'
skip-viz: true
Expand Down
48 changes: 38 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,61 @@
# Note: use tabs
# Check Python major and minor version
# For more information, see https://stackoverflow.com/a/22105036
PYV = $(shell python -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)")

# Note: use tabs (not spaces) for indentation
# actions which are virtual, i.e. not a script
.PHONY: install-deps install-tb freeze-deps test
.PHONY: install install-deps install-tb install-for-test freeze-deps upgrade-deps test test-core test-forecast test-viz ensure-deps-folder

install: install-deps install-tb

install-for-test:
pip install setuptools_scm pytest

install-deps:
pip install --upgrade pip-tools
pip-sync dev/requirements.txt
pip-sync dev/${PYV}/requirements.txt
pip install pre-commit

freeze-deps:
pip install --upgrade pip-tools
pip-compile -o dev/requirements.txt # use --upgrade or --upgrade-package to actually change versions

install-tb:
pip install -e .
pre-commit install

freeze-deps:
make ensure-deps-folder
pip install --upgrade pip-tools
pip-compile -o dev/${PYV}/requirements.txt

upgrade-deps:
make ensure-deps-folder
pip install --upgrade pip-tools
pip-compile -o dev/${PYV}/requirements.txt --upgrade
ifneq ($(skip-test), yes)
make test
endif

test:
make test-core # test just the core, which may have fewer pinned dependencies
make test-all # test everything sharing the same dependencies

test-all:
pip install -e .[forecast,viz]
make install-for-test
pytest

test-core:
pip install -e .
pip install setuptools_scm pytest
make install-for-test
pytest --ignore test_forecast__ --ignore test_viz__

test-forecast:
pip install -e .[forecast]
pip install setuptools_scm pytest
make install-for-test
pytest -k test_forecast__

test-viz:
pip install -e .[viz]
pip install setuptools_scm pytest
make install-for-test
pytest -k test_viz__

ensure-deps-folder:
mkdir -p dev/${PYV}
52 changes: 52 additions & 0 deletions dev/3.11/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=dev/3.11/requirements.txt
#
dill==0.3.8
# via openturns
greenlet==3.1.0
# via sqlalchemy
importlib-metadata==8.5.0
# via timely-beliefs (setup.py)
isodate==0.6.1
# via timely-beliefs (setup.py)
numpy==1.26.4 ; python_version > "3.7"
# via
# pandas
# properscoring
# scipy
# timely-beliefs (setup.py)
openturns==1.23
# via timely-beliefs (setup.py)
pandas==2.2.1 ; python_version > "3.7"
# via timely-beliefs (setup.py)
properscoring==0.1
# via timely-beliefs (setup.py)
psutil==6.0.0
# via openturns
psycopg2-binary==2.9.9
# via timely-beliefs (setup.py)
python-dateutil==2.9.0.post0
# via pandas
pytz==2024.2
# via
# pandas
# timely-beliefs (setup.py)
scipy==1.14.1 ; python_version > "3.7"
# via
# properscoring
# timely-beliefs (setup.py)
six==1.16.0
# via
# isodate
# python-dateutil
sqlalchemy==2.0.35
# via timely-beliefs (setup.py)
typing-extensions==4.12.2
# via sqlalchemy
tzdata==2024.1
# via pandas
zipp==3.20.2
# via importlib-metadata
2 changes: 1 addition & 1 deletion dev/requirements.txt → dev/3.9/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=dev/requirements.txt
# pip-compile --output-file=dev/3.9/requirements.txt
#
altair==4.1.0
# via timely-beliefs (setup.py)
Expand Down
4 changes: 2 additions & 2 deletions dev/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ And run tests:

To update dependencies run:

pip-compile -o dev/requirements.txt -U
make upgrade-deps

To install dependencies run:

pip install -r dev/requirements.txt
make install-deps
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
Expand Down Expand Up @@ -65,8 +67,7 @@ viz = [
]
forecast = [
"sktime",
"numpy<1.25,>=1.21.0; python_version > '3.7'", # required by sktime==0.15.0
"scipy<2.0.0; python_version > '3.7'", # required by sktime==0.15.0
"numpy>=1.21.0; python_version > '3.7'", # required by sktime==0.15.0
]

[project.readme]
Expand Down
2 changes: 1 addition & 1 deletion timely_beliefs/tests/test_df_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def test_downsample_once_upsample_once_around_dst(
df = df_wxyz(
time_slot_sensor, 25, 1, 1, 1, start
) # 1 deterministic belief per event
df.iloc[0] = np.NaN # introduce 1 NaN value
df.iloc[0] = np.nan # introduce 1 NaN value
print(df)

# Downsample the original frame
Expand Down
Loading