Skip to content

Commit ef72c85

Browse files
committed
added setupvenv to devtools, checked pillow
1 parent 4b74f64 commit ef72c85

File tree

2 files changed

+90
-31
lines changed

2 files changed

+90
-31
lines changed

devtools/setupvenv.py

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#
2+
# %%
3+
from pathlib import Path
4+
import shutil
5+
import venv
6+
import subprocess as sp
7+
8+
9+
# %%
10+
### Define paths
11+
def makepath(*args) -> str:
12+
return str(Path(*args))
13+
14+
# :: Check Project Root!
15+
ROOT = ".."
16+
17+
PROJ = makepath(ROOT, ".") # > Project location for editable install
18+
VENV = makepath(ROOT, "venv") # > Virtual environment location
19+
PYTHON = makepath(ROOT, "venv", "bin", "python") # > Python executable
20+
REQUIREMENTS = makepath(ROOT, "requirements.txt")
21+
22+
23+
# %%
24+
### make virtual environment
25+
# > Delete venv if it exists
26+
if Path(VENV).exists():
27+
shutil.rmtree(VENV)
28+
29+
venv.create(VENV, with_pip=True)
30+
31+
32+
# %%
33+
### Install this project
34+
sp.run([PYTHON, "-m", "pip", "install", "-e", PROJ])
35+
# %%
36+
### Create requirements.txt
37+
with open(REQUIREMENTS, "w") as f:
38+
sp.call(
39+
[
40+
PYTHON,
41+
"-m",
42+
"pip",
43+
"freeze",
44+
"--exclude-editable",
45+
"-l",
46+
">",
47+
REQUIREMENTS,
48+
],
49+
stdout=f,
50+
)
51+
# %%
52+
### Install devtools
53+
sp.run([PYTHON, "-m", "pip", "install", "-e", f"{PROJ}[dev]"])
54+
55+
56+
# %%
57+
#:: Switch to venv !! ==================================================
58+
# %%
59+
### test packages
60+
import numpy as np
61+
62+
np.__version__
63+
64+
# %%
65+
import pytest
66+
67+
pytest.__version__

requirements.txt

+23-31
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,58 @@
11
appnope==0.1.3
22
asttokens==2.4.1
3-
certifi==2023.11.17
4-
charset-normalizer==3.3.2
53
colorama==0.4.6
64
colour==0.1.5
7-
comm==0.2.0
5+
comm==0.2.1
86
contourpy==1.2.0
97
cycler==0.12.1
108
debugpy==1.8.0
119
decorator==5.1.1
1210
et-xmlfile==1.1.0
1311
executing==2.0.1
14-
fonttools==4.45.0
12+
fonttools==4.47.2
1513
icecream==2.1.3
16-
idna==3.4
17-
ipykernel==6.26.0
14+
ipykernel==6.29.0
1815
ipynbname==2023.2.0.0
19-
ipython==8.17.2
16+
ipython==8.20.0
2017
jedi==0.19.1
2118
joblib==1.3.2
2219
jupyter_client==8.6.0
23-
jupyter_core==5.5.0
20+
jupyter_core==5.7.1
2421
kiwisolver==1.4.5
25-
littleutils==0.2.2
2622
matplotlib==3.8.2
2723
matplotlib-inline==0.1.6
28-
nest-asyncio==1.5.8
29-
numpy==1.26.2
24+
nest-asyncio==1.6.0
25+
numpy==1.26.3
3026
openpyxl==3.1.2
31-
outdated==0.2.2
3227
packaging==23.2
3328
pandas==1.5.3
3429
pandas-flavor==0.6.0
3530
parso==0.8.3
36-
patsy==0.5.3
37-
pexpect==4.8.0
38-
Pillow>=10.2.0
39-
pingouin==0.5.3
40-
platformdirs==4.0.0
41-
prompt-toolkit==3.0.41
42-
psutil==5.9.6
31+
patsy==0.5.6
32+
pexpect==4.9.0
33+
pillow==10.2.0
34+
pingouin==0.5.4
35+
platformdirs==4.1.0
36+
prompt-toolkit==3.0.43
37+
psutil==5.9.8
4338
ptyprocess==0.7.0
4439
pure-eval==0.2.2
45-
Pygments==2.17.1
40+
Pygments==2.17.2
4641
pyparsing==3.1.1
4742
python-dateutil==2.8.2
4843
pytz==2023.3.post1
49-
pyzmq==25.1.1
50-
requests==2.31.0
51-
scikit-learn==1.3.2
52-
scipy==1.11.4
44+
pyzmq==25.1.2
45+
scikit-learn==1.4.0
46+
scipy==1.12.0
5347
seaborn==0.11.2
5448
six==1.16.0
5549
stack-data==0.6.3
5650
statannotations==0.6.0
57-
statsmodels==0.14.0
51+
statsmodels==0.14.1
5852
tabulate==0.9.0
5953
threadpoolctl==3.2.0
60-
toml==0.10.2
61-
tornado==6.3.3
62-
traitlets==5.13.0
63-
urllib3==2.1.0
64-
wcwidth==0.2.10
65-
xarray==2023.11.0
54+
tornado==6.4
55+
traitlets==5.14.1
56+
wcwidth==0.2.13
57+
xarray==2024.1.1
6658
XlsxWriter==3.1.9

0 commit comments

Comments
 (0)