Skip to content

Commit 01af528

Browse files
committed
517
1 parent 87b13de commit 01af528

File tree

9 files changed

+38
-30
lines changed

9 files changed

+38
-30
lines changed

.github/workflows/build-multiarch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ jobs:
7979
if python3 -c "import subprocess; exit('no such option' not in subprocess.getoutput('pip3 install --break-system-packages'))"; then
8080
# If the exit status is 0 (True), this means the option is not supported
8181
python3 -m pip install wheel
82-
pip3 install -r requirements_test_multiarch.txt
82+
pip3 install -e .[test-multiarch]
8383
else
8484
# If the exit status is 1 (False), this means the option is supported
8585
python3 -m pip install wheel --break-system-packages
86-
pip3 install -r requirements_test_multiarch.txt --break-system-packages
86+
pip3 install -e .[test-multiarch] --break-system-packages
8787
fi
8888
python3 -m pytest . -v -m "not online and not thermo and not numba"

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ jobs:
8686
if: startsWith(runner.os, 'Linux')
8787
with:
8888
path: ~/.cache/pip
89-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
89+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
9090
restore-keys: |
9191
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
9292
- name: cache MacOS
9393
uses: actions/cache@v4
9494
if: startsWith(runner.os, 'macOS')
9595
with:
9696
path: ~/Library/Caches/pip
97-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
97+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
9898
restore-keys: |
9999
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
100100
- name: cache Windows
101101
uses: actions/cache@v4
102102
if: startsWith(runner.os, 'Windows')
103103
with:
104104
path: ~\AppData\Local\pip\Cache
105-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
105+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
106106
restore-keys: |
107107
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
108108
@@ -118,11 +118,11 @@ jobs:
118118
python -c "import platform; print(platform.platform()); print(platform.architecture())"
119119
python -m pip install --upgrade pip
120120
python -m pip install wheel
121-
pip install -r requirements_test.txt
121+
pip install -e .[test]
122122
- name: Add numba
123123
if: ${{ !contains(fromJSON('["pypy3.9", "3.13t"]'), matrix.python-version) }}
124124
run: |
125-
pip install numba
125+
pip install -e .[numba]
126126
- name: Test with pytest
127127
run: |
128128
pytest . -v --cov-report html --cov=fluids --cov-report term-missing -m "not online and not thermo"

.github/workflows/build_cxfreeze_library.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ jobs:
3333
if: startsWith(runner.os, 'Linux')
3434
with:
3535
path: ~/.cache/pip
36-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
36+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
3737
restore-keys: |
3838
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
3939
- name: cache MacOS
4040
uses: actions/cache@v4
4141
if: startsWith(runner.os, 'macOS')
4242
with:
4343
path: ~/Library/Caches/pip
44-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
44+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
4545
restore-keys: |
4646
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
4747
- name: cache Windows
4848
uses: actions/cache@v4
4949
if: startsWith(runner.os, 'Windows')
5050
with:
5151
path: ~\AppData\Local\pip\Cache
52-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
52+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
5353
restore-keys: |
5454
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
5555
@@ -65,7 +65,7 @@ jobs:
6565
python -c "import platform; print(platform.platform()); print(platform.architecture())"
6666
python -m pip install --upgrade pip
6767
python -m pip install wheel
68-
pip install -r requirements_test.txt
68+
pip install -e .[test]
6969
pip install cx_Freeze
7070
7171
- name: Install fluids

.github/workflows/build_multi_numpy_scipy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
if: startsWith(runner.os, 'Linux')
8585
with:
8686
path: ~/.cache/pip
87-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
87+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
8888
restore-keys: |
8989
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
9090
- name: Install Ubuntu dependencies
@@ -99,12 +99,12 @@ jobs:
9999
python -c "import platform; print(platform.platform()); print(platform.architecture())"
100100
python -m pip install --upgrade pip
101101
python -m pip install wheel
102-
pip install -r requirements_test.txt
102+
pip install -e .[test]
103103
pip install numpy==${{ matrix.numpy }} scipy==${{ matrix.scipy }}
104104
- name: Add numba
105105
if: ${{ !contains(fromJSON('["pypy3.9"]'), matrix.python-version) }}
106106
run: |
107-
pip install numba
107+
pip install -e .[numba]
108108
- name: Test with pytest
109109
run: |
110110
pytest . -v --cov-report html --cov=fluids --cov-report term-missing -m "not online and not thermo and not numba"

.github/workflows/build_nuitka_library.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@ jobs:
6969
if: startsWith(runner.os, 'Linux')
7070
with:
7171
path: ~/.cache/pip
72-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
72+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
7373
restore-keys: |
7474
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
7575
- name: cache MacOS
7676
uses: actions/cache@v4
7777
if: startsWith(runner.os, 'macOS')
7878
with:
7979
path: ~/Library/Caches/pip
80-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
80+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
8181
restore-keys: |
8282
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
8383
- name: cache Windows
8484
uses: actions/cache@v4
8585
if: startsWith(runner.os, 'Windows')
8686
with:
8787
path: ~\AppData\Local\pip\Cache
88-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
88+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
8989
restore-keys: |
9090
${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip-
9191
@@ -101,12 +101,12 @@ jobs:
101101
python -c "import platform; print(platform.platform()); print(platform.architecture())"
102102
python -m pip install --upgrade pip
103103
python -m pip install wheel
104-
pip install -r requirements_test.txt
104+
pip install -e .[test]
105105
pip install nuitka
106106
- name: Add numba
107107
if: ${{ !contains(fromJSON('["pypy3.9"]'), matrix.python-version) }}
108108
run: |
109-
pip install numba
109+
pip install -e .[numba]
110110
- name: Build nuitka library
111111
run: |
112112
python -m nuitka --module fluids --include-package=fluids

.github/workflows/build_py2exe_library.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: actions/cache@v4
3131
with:
3232
path: ~\AppData\Local\pip\Cache
33-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
33+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
3434
restore-keys: |
3535
${{ runner.os }}-x64-${{ matrix.python-version }}pip-
3636
@@ -39,7 +39,7 @@ jobs:
3939
python -c "import platform; print(platform.platform()); print(platform.architecture())"
4040
python -m pip install --upgrade pip
4141
python -m pip install wheel setuptools
42-
pip install -r requirements_test.txt
42+
pip install -e .[test]
4343
pip install py2exe
4444
4545
- name: Install fluids

.github/workflows/build_pyinstaller_library.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/cache@v4
3232
with:
3333
path: ~\AppData\Local\pip\Cache
34-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }}
34+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
3535
restore-keys: |
3636
${{ runner.os }}-x64-${{ matrix.python-version }}pip-
3737
@@ -40,7 +40,7 @@ jobs:
4040
python -c "import platform; print(platform.platform()); print(platform.architecture())"
4141
python -m pip install --upgrade pip
4242
python -m pip install wheel
43-
pip install -r requirements_test.txt
43+
pip install -e .[test]
4444
pip install pyinstaller
4545
4646
- name: Install fluids

.github/workflows/security.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install pip-audit
28+
pip install -e .[security]
2929
3030
- name: Run pip-audit
3131
run: |
32-
pip-audit -r requirements.txt
32+
pip-audit
3333
3434
bandit:
3535
runs-on: ubuntu-latest
@@ -45,7 +45,7 @@ jobs:
4545
- name: Install dependencies
4646
run: |
4747
python -m pip install --upgrade pip
48-
pip install bandit
48+
pip install -e .[security]
4949
5050
- name: Run bandit security scan
5151
run: |

Justfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ VENV_PYTHON := ".venv/bin/python"
99
VENV_PYTEST := ".venv/bin/pytest"
1010
VENV_MYPY := ".venv/bin/mypy"
1111
VENV_RUFF := ".venv/bin/ruff"
12+
VENV_PIP_AUDIT := ".venv/bin/pip-audit"
13+
VENV_BANDIT := ".venv/bin/bandit"
1214

1315
# --- Main Recipes ---
1416

@@ -20,10 +22,8 @@ default:
2022
install:
2123
@echo ">>> Creating virtual environment in ./.venv..."
2224
@uv venv
23-
@echo "\n>>> Installing dependencies from requirements files..."
24-
@uv pip install -r requirements_docs.txt
25-
@echo "\n>>> Installing 'fluids' in editable mode..."
26-
@uv pip install -e .
25+
@echo "\n>>> Installing 'fluids' in editable mode with dev dependencies..."
26+
@uv pip install -e .[dev]
2727
@echo "\n>>> Installing prek hooks..."
2828
@prek install
2929
@echo "\n✅ Environment setup complete! You can now run other commands."
@@ -58,6 +58,14 @@ lint:
5858
## 🏁 check: Run all checks (linting and type checking).
5959
check: lint typecheck
6060

61+
## 🔒 security: Run security scans with pip-audit and bandit.
62+
security:
63+
@echo ">>> Running pip-audit..."
64+
@{{VENV_PIP_AUDIT}} -r requirements.txt
65+
@echo ">>> Running bandit..."
66+
@{{VENV_BANDIT}} -r fluids -ll
67+
@echo "✅ Security scans complete."
68+
6169
## 🪝 precommit: Run pre-commit hooks on all files.
6270
precommit:
6371
@echo ">>> Running pre-commit hooks..."

0 commit comments

Comments
 (0)