Skip to content

Commit 620bf83

Browse files
authored
Merge pull request #984 from AVSLab/enhancement/214-pin-all-python-dependency-versions-ids
2 parents c5abec9 + 5f88269 commit 620bf83

10 files changed

Lines changed: 168 additions & 35 deletions

File tree

.github/workflows/canary.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "Canary Build"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
6+
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- develop
10+
paths:
11+
- '.github/workflows/canary.yml'
12+
- '.github/workflows/requirements.txt'
13+
- '.github/workflows/requirements_dev.txt'
14+
- '.github/workflows/requirements_doc.txt'
15+
- 'conanfile.py'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build-macOS-canary:
23+
name: macOS Latest Dependencies
24+
runs-on: macos-latest
25+
timeout-minutes: 75
26+
strategy:
27+
matrix:
28+
python-version: [ "3.13" ]
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install Homebrew
38+
run: |
39+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
40+
brew install swig doxygen
41+
42+
- name: "Create virtual Environment"
43+
run: python3 -m venv .venv
44+
- name: "Capture initial package versions"
45+
run: |
46+
source .venv/bin/activate
47+
pip freeze > initial_versions.txt
48+
echo "Initial package versions:" >> $GITHUB_STEP_SUMMARY
49+
cat initial_versions.txt >> $GITHUB_STEP_SUMMARY
50+
echo "\n" >> $GITHUB_STEP_SUMMARY
51+
52+
- name: "Install canary requirements"
53+
run: |
54+
source .venv/bin/activate
55+
pip3 install -r .github/workflows/requirements.txt
56+
pip3 install -r .github/workflows/requirements_dev.txt
57+
pip3 install -r .github/workflows/requirements_doc.txt
58+
pip3 install pytest-error-for-skips
59+
60+
- name: "Capture final package versions"
61+
run: |
62+
source .venv/bin/activate
63+
pip freeze > final_versions.txt
64+
echo "Final package versions:" >> $GITHUB_STEP_SUMMARY
65+
cat final_versions.txt >> $GITHUB_STEP_SUMMARY
66+
echo "\n" >> $GITHUB_STEP_SUMMARY
67+
echo "Package version changes:" >> $GITHUB_STEP_SUMMARY
68+
diff -u initial_versions.txt final_versions.txt | grep -E '^[+-]' | grep -v '^+++' | grep -v '^---' >> $GITHUB_STEP_SUMMARY
69+
70+
- name: "Build basilisk with latest dependencies"
71+
run: source .venv/bin/activate && python3 conanfile.py --opNav True --allOptPkg --mujoco True --mujocoReplay True --pyPkgCanary True
72+
73+
- name: "Run Python Tests"
74+
run: |
75+
source .venv/bin/activate
76+
cd src
77+
pytest -n auto -m "not ciSkip" -rs --error-for-skips
78+
if: ${{ always() }}
79+
- name: "Run C/C++ Tests"
80+
working-directory: ./dist3
81+
run: ctest -C Release
82+
if: ${{ always() }}
83+
84+
- name: "Build Documentation"
85+
run: |
86+
source .venv/bin/activate
87+
cd docs
88+
make html SPHINXOPTS="-W"
89+
if: ${{ always() }}
90+
91+
- name: "Upload package version logs"
92+
if: always()
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: package-versions
96+
path: |
97+
initial_versions.txt
98+
final_versions.txt

.github/workflows/requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pandas
2+
matplotlib
3+
numpy
4+
colorama
5+
tqdm
6+
pillow
7+
requests
8+
bokeh
9+
protobuf
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
wheel
2+
cmake<4.0
3+
conan
4+
packaging
5+
setuptools
6+
setuptools-scm
7+
8+
pytest
9+
pytest-html
10+
pytest-xdist
11+
12+
pre-commit
13+
clang-format
14+
15+
psutil
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
breathe
2+
docutils
3+
recommonmark
4+
sphinx
5+
sphinx_rtd_theme
6+
sphinx-copybutton

conanfile.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"vizInterface": [[True, False], True],
3838
"mujoco": [[True, False], False],
3939
"buildProject": [[True, False], True],
40+
"pyPkgCanary": [[True, False], False],
4041

4142
# XXX: Set managePipEnvironment to True to keep the old behaviour of
4243
# managing the `pip` environment directly (upgrading, installing Python
@@ -123,19 +124,21 @@ def system_requirements(self):
123124
# TODO: Remove this: requirements and optional requirements are
124125
# installed automatically by add_basilisk_to_sys_path(). Only build
125126
# system requirements need to be installed here.
126-
reqFile = open('requirements.txt', 'r')
127+
reqPath = '.github/workflows/' if self.options.get_safe("pyPkgCanary") else ''
128+
129+
reqFile = open(f'{reqPath}requirements.txt', 'r')
127130
required = reqFile.read().replace("`", "").split('\n')
128131
reqFile.close()
129132
pkgList = [x.lower() for x in required]
130133

131-
reqFile = open('requirements_dev.txt', 'r')
134+
reqFile = open(f'{reqPath}requirements_dev.txt', 'r')
132135
required = reqFile.read().replace("`", "").split('\n')
133136
reqFile.close()
134137
pkgList += [x.lower() for x in required]
135138

136139
checkStr = "Required"
137140
if self.options.get_safe("allOptPkg"):
138-
optFile = open('requirements_doc.txt', 'r')
141+
optFile = open(f'{reqPath}requirements_doc.txt', 'r')
139142
optionalPkgs = optFile.read().replace("`", "").split('\n')
140143
optFile.close()
141144
optionalPkgs = [x.lower() for x in optionalPkgs]

docs/source/Support/bskReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Version |release|
2929
- Marked the use of python 3.8 as deprecated
3030
- Support for ``opNavMode`` flag within vizSupport was removed, as its deprecation period ended
3131
- Demo video was added to :ref:`scenarioQuadMaps` documentation
32+
- Pinned python dependencies to avoid issues with new package versions.
33+
- Added a new github workflow job ``canary`` to routinely check the compatibility of latest python dependencies with python 3.13 on the latest mac-os.
3234

3335

3436
Version 2.7.0 (April 20, 2025)
@@ -81,6 +83,7 @@ Version 2.7.0 (April 20, 2025)
8183
- :beta:`Mujoco Support`: Added ``StatefulSysModel`` for models in the dynamics task of ``MJScene`` that need to declare
8284
continuous-time states. Modified :ref:`scenarioDeployPanels` to illustrate the use of ``StatefulSysModel``.
8385

86+
8487
Version 2.6.0 (Feb. 21, 2025)
8588
-------------------------------
8689
- Build ``ubuntu-latest`` wheels for Python 3.9, 3.10, and 3.11 on GitHub CI, allowing for

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[build-system]
22
build-backend = "setuptools.build_meta"
33
requires = [
4-
"setuptools>=70.1.0", # Required for "bdist_wheel" to work correctly.
5-
"setuptools-scm>=8.0", # Automatically include all Git-controlled files in sdist
6-
"packaging>=22", # Due to incompatibility: https://github.com/pypa/setuptools/issues/4483
4+
"setuptools>=70.1.0,<=78.1.0", # Required for "bdist_wheel" to work correctly.
5+
"setuptools-scm>=8.0,<=8.2.1", # Automatically include all Git-controlled files in sdist
6+
"packaging>=22,<=24.2", # Due to incompatibility: https://github.com/pypa/setuptools/issues/4483
77

88
# Requirements for building Basilisk through conanfile
9-
"conan>=2.0.5",
9+
"conan>=2.0.5,<=2.15.1",
1010
"cmake>=3.26,<4.0",
1111
"swig>=4.2.1" # Known to work with https://github.com/nightlark/swig-pypi/pull/120
1212
]

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
pandas
2-
matplotlib
3-
numpy
4-
colorama
5-
tqdm
6-
Pillow
7-
requests
8-
bokeh
9-
protobuf
1+
pandas<=2.2.3,>=2.0.3
2+
matplotlib<=3.10.1,>=3.7.5
3+
numpy<=2.2.4,>=1.24.4
4+
colorama==0.4.6
5+
tqdm==4.67.1
6+
pillow<=11.2.1,>=10.4.0
7+
requests==2.32.3
8+
bokeh<=3.7.2,>=3.1.1
9+
protobuf<=6.30.2,>=5.29.4

requirements_dev.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
wheel
2-
cmake<4.0
3-
conan>2.0.5
4-
packaging>=22
5-
setuptools>=70.1.0
6-
setuptools-scm>=8.0
1+
wheel>=0.45.1,<=0.46.1
2+
cmake>=3.26,<4.0
3+
conan>=2.0.5,<=2.15.1
4+
packaging>=22,<=24.2
5+
setuptools>=70.1.0,<=78.1.0
6+
setuptools-scm>=8.0,<=8.2.1
77

8-
pytest
9-
pytest-html
10-
pytest-xdist
8+
pytest==8.3.5
9+
pytest-html==4.1.1
10+
pytest-xdist==3.6.1
1111

12-
pre-commit
13-
clang-format
12+
pre-commit>=3.5.0,<=4.2.0
13+
clang-format==20.1.0
1414

15-
psutil
15+
psutil==7.0.0

requirements_doc.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
breathe
2-
docutils
3-
recommonmark
4-
sphinx>7.0.0
5-
sphinx_rtd_theme>=3.0.0
6-
sphinx-copybutton
7-
docutils
1+
breathe==4.36.0
2+
docutils==0.21.2
3+
recommonmark==0.7.1
4+
sphinx>7.0.0,=<8.2.3
5+
sphinx_rtd_theme>=3.0.0,<=3.0.2
6+
sphinx-copybutton==0.5.2

0 commit comments

Comments
 (0)