Skip to content

Commit 71ce2f3

Browse files
33 update to use only pip to install (#34)
* 33 - devcontainer updated to use linux install with pre-requisites * 33 - Readme update to include installs for all supported OS * 33 - workflow update to test install options * 33 - update actions test workflow * 33 - update workflow * 33 - update workflow * 33 - update name of devcontainer
1 parent 6d7cf0b commit 71ce2f3

File tree

3 files changed

+178
-57
lines changed

3 files changed

+178
-57
lines changed

.devcontainer/devcontainer.json

+57-51
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,61 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/python
33
{
4-
"name": "Test Harness",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/anaconda:0.204.15-3",
7-
// Features to add to the dev container. More info: https://containers.dev/features.
8-
"features": {
9-
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
10-
"packages": "default-jre"
11-
}
12-
},
13-
"customizations": {
14-
"vscode": {
15-
"settings": {
16-
"black-formatter.args": [
17-
"--preview",
18-
"--line-length",
19-
"79"
20-
],
21-
"[python]": {
22-
"editor.rulers": [
23-
{
24-
"column": 79
25-
}
26-
]
27-
}
28-
},
29-
"extensions": [
30-
"ms-python.black-formatter",
31-
"ms-python.vscode-pylance",
32-
"ms-python.python",
33-
"GitHub.copilot-chat",
34-
"GitHub.copilot"
35-
]
36-
}
37-
},
38-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
39-
// "forwardPorts": [],
40-
// Use 'postCreateCommand' to run commands after the container is created.
41-
"postCreateCommand": {
42-
"1": "conda install -y python=3.11.8 && conda install -y -c conda-forge cvxopt && conda install -y -c conda-forge pygraphviz && pip3 install --user -r requirements.txt && bash scripts/install_repositories.sh",
43-
"2": "echo 'export PYTHONPATH=${containerWorkspaceFolder}:$PYTHONPATH' >> ~/.bashrc"
44-
},
45-
// Add repo to safe directories
46-
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
47-
// Configure tool-specific properties.
48-
// "customizations": {},
49-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
50-
// "remoteUser": "root"
51-
"mounts": [
52-
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
53-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached"
54-
]
4+
"name": "Otel2Puml",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
"features": {
9+
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
10+
"packages": [
11+
"liblapack-dev",
12+
"libopenblas-dev",
13+
"libsuitesparse-dev",
14+
"libglpk-dev",
15+
"default-jre"
16+
]
17+
}
18+
},
19+
"customizations": {
20+
"vscode": {
21+
"settings": {
22+
"black-formatter.args": [
23+
"--preview",
24+
"--line-length",
25+
"79"
26+
],
27+
"[python]": {
28+
"editor.rulers": [
29+
{
30+
"column": 79
31+
}
32+
]
33+
}
34+
},
35+
"extensions": [
36+
"ms-python.black-formatter",
37+
"ms-python.vscode-pylance",
38+
"ms-python.python",
39+
"GitHub.copilot-chat",
40+
"GitHub.copilot"
41+
]
42+
}
43+
},
44+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
45+
// "forwardPorts": [],
46+
// Use 'postCreateCommand' to run commands after the container is created.
47+
"postCreateCommand": {
48+
"1": "export CPPFLAGS='-I/usr/include/suitesparse' && export CVXOPT_BUILD_GLPK=1 && pip install -r requirements.txt && bash scripts/install_repositories.sh",
49+
"2": "echo 'export PYTHONPATH=${containerWorkspaceFolder}:$PYTHONPATH' >> ~/.bashrc"
50+
},
51+
// Add repo to safe directories
52+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
53+
// Configure tool-specific properties.
54+
// "customizations": {},
55+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
56+
// "remoteUser": "root",
57+
"mounts": [
58+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
59+
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached"
60+
]
5561
}

.github/workflows/test-workflow.yml

+69-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: s-weigand/setup-conda@v1
3030
with:
3131
update-conda: true
32-
python-version: 3.11.8
32+
python-version: 3.11.9
3333
conda-channels: conda-forge
3434

3535
- name: Install pre-requisites
@@ -48,12 +48,78 @@ jobs:
4848
run: |
4949
export PIP_CONSTRAINT='pip_constraint.txt'
5050
pip install --upgrade pip
51-
52-
pip install pytest
51+
pip install -r requirements.txt
5352
pytest --version
5453
54+
- name: Run Tests
55+
run: |
56+
pytest
57+
58+
run-tests-check-no-anaconda-linux:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Setup Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Setup Python
65+
uses: actions/setup-python@v4
66+
with:
67+
python-version: '3.11.9'
68+
cache: 'pip'
69+
70+
- name: Install pre-requisites
71+
run: |
72+
sudo apt update
73+
sudo apt install -y liblapack-dev libblas-dev
74+
sudo apt install -y libsuitesparse-dev
75+
sudo apt install -y libsuitesparse-dev
76+
77+
- name: Install janus and erebus as packages
78+
run: |
79+
chmod +x ./scripts/install_repositories.sh && ./scripts/install_repositories.sh
80+
81+
- name: Add GitHub workspace to PYTHONPATH
82+
run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
83+
84+
- name: Install Requirements
85+
run: |
86+
export PIP_CONSTRAINT='pip_constraint.txt'
87+
pip install --upgrade pip
88+
export CPPFLAGS="-I/usr/include/suitesparse"
89+
export CVXOPT_BUILD_GLPK=1
5590
pip install -r requirements.txt
91+
pytest --version
5692
5793
- name: Run Tests
5894
run: |
5995
pytest
96+
97+
run-tests-check-no-anaconda-mac-os:
98+
runs-on: macos-latest
99+
steps:
100+
- name: Setup Checkout
101+
uses: actions/checkout@v4
102+
103+
- name: Setup Python
104+
uses: actions/setup-python@v4
105+
with:
106+
python-version: '3.11.9'
107+
cache: 'pip'
108+
109+
- name: Install janus and erebus as packages
110+
run: |
111+
chmod +x ./scripts/install_repositories.sh && ./scripts/install_repositories.sh
112+
113+
- name: Add GitHub workspace to PYTHONPATH
114+
run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
115+
116+
- name: Install Requirements
117+
run: |
118+
export PIP_CONSTRAINT='pip_constraint.txt'
119+
pip install --upgrade pip
120+
pip install -r requirements.txt
121+
pytest --version
122+
123+
- name: Run Tests
124+
run: |
125+
pytest

README.md

+52-3
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,24 @@ There are two ways to set up this project: manual installation or using a devcon
117117

118118
### Manual Installation
119119

120+
The project can be installed manually in a few different ways. Make sure you have the following prerequisites for all installation methods:
121+
* `git`
122+
* Python version 3.11.9 or lower
123+
* `bash`
124+
* `pip` (Python package manager)
125+
126+
(OPTIONAL) If you want to use the following functions:
127+
* `tel2puml.events.save_vis_logic_gate_tree`
128+
* `tel2puml.utils.get_graphviz_plot`
129+
you will also need:
130+
* Java runtime environment (can be installed via `apt install default-jre` if using debian but will vary depending on your OS)
131+
* [Graphviz](https://graphviz.org/download/) installed
132+
133+
#### With Anaconda (Recommended)
134+
120135
Before proceeding with the manual installation, ensure you have the following prerequisites:
121136

122137
* [Anaconda](https://conda.io/projects/conda/en/latest/index.html) installed and managing the Python installation
123-
* Python version 3.11.8 or lower
124-
* Java runtime environment (can be installed via `apt install default-jre`)
125-
* [Graphviz](https://graphviz.org/download/) installed
126138

127139
To install the project manually:
128140

@@ -137,6 +149,43 @@ conda install -c conda-forge pygraphviz
137149
python3.11 -m pip install -r requirements.txt
138150
```
139151

152+
#### Without Anaconda
153+
154+
If you don't have Anaconda installed, you can still install the project manually on both linux distributions and MacOS.
155+
156+
##### Linux
157+
Before proceeding, ensure you have the following prerequisites that are required (since there is no build wheel for cvxopt1.3.2 for linux):
158+
159+
* lapack and blas libraries installed (can be installed via `apt install liblapack-dev libblas-dev` if using debian but will vary depending on your OS)
160+
* suiteparse library installed (can be installed via `apt install libsuitesparse-dev` if using debian but will vary depending on your OS)
161+
* glpk library installed (can be installed via `apt install libglpk-dev` if using debian but will vary depending on your OS)
162+
163+
To install the project manually:
164+
165+
1. Set up a Python virtual environment (recommended)
166+
2. Navigate to the project root directory
167+
3. Run the following commands:
168+
169+
```bash
170+
./scripts/install_repositories.sh
171+
export CPPFLAGS="-I/usr/include/suitesparse"
172+
export CVXOPT_BUILD_GLPK=1
173+
python3.11 -m pip install -r requirements.txt
174+
```
175+
176+
##### MacOS
177+
178+
To install the project manually on MacOS:
179+
180+
1. Set up a Python virtual environment (recommended)
181+
2. Navigate to the project root directory
182+
3. Run the following commands:
183+
184+
```bash
185+
./scripts/install_repositories.sh
186+
python3.11 -m pip install -r requirements.txt
187+
```
188+
140189
### Using Devcontainer
141190

142191
Alternatively, you can use the provided devcontainer, which manages all dependencies automatically. To use the devcontainer:

0 commit comments

Comments
 (0)