Skip to content

Commit f8698eb

Browse files
ahelwerlemmy
authored andcommitted
Added Python venv instructions
Signed-off-by: Andrew Helwer <[email protected]>
1 parent 6d47e12 commit f8698eb

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

.github/workflows/CI.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ jobs:
4141
if: matrix.os == 'windows-latest'
4242
- name: Install python packages
4343
shell: bash
44-
run: pip install -r $SCRIPT_DIR/requirements.txt
44+
run: |
45+
python -m venv .
46+
source ./bin/activate
47+
pip install -r $SCRIPT_DIR/requirements.txt
4548
- name: Download TLA⁺ dependencies
4649
run: |
4750
# Fix tar symbolic link issues on Windows; see:
@@ -67,25 +70,38 @@ jobs:
6770
mv tlapm-$TLAPS_VERSION tlapm
6871
- name: Check manifest.json format
6972
shell: bash
70-
run: python $SCRIPT_DIR/check_manifest_schema.py
73+
run: |
74+
source ./bin/activate
75+
python $SCRIPT_DIR/check_manifest_schema.py
7176
- name: Check manifest files
7277
shell: bash
73-
run: python $SCRIPT_DIR/check_manifest_files.py
78+
run: |
79+
source ./bin/activate
80+
python $SCRIPT_DIR/check_manifest_files.py
7481
- name: Check manifest feature flags
7582
shell: bash
76-
run: python $SCRIPT_DIR/check_manifest_features.py
83+
run: |
84+
source ./bin/activate
85+
python $SCRIPT_DIR/check_manifest_features.py
7786
- name: Parse all modules
7887
shell: bash
79-
run: python $SCRIPT_DIR/parse_modules.py
88+
run: |
89+
source ./bin/activate
90+
python $SCRIPT_DIR/parse_modules.py
8091
- name: Check small models
8192
shell: bash
82-
run: python $SCRIPT_DIR/check_small_models.py
93+
run: |
94+
source ./bin/activate
95+
python $SCRIPT_DIR/check_small_models.py
8396
- name: Smoke-test large models
8497
shell: bash
85-
run: python $SCRIPT_DIR/smoke_test_large_models.py
98+
run: |
99+
source ./bin/activate
100+
python $SCRIPT_DIR/smoke_test_large_models.py
86101
- name: Smoke-test manifest generation script
87102
shell: bash
88103
run: |
104+
source ./bin/activate
89105
rm -r build
90106
python $SCRIPT_DIR/generate_manifest.py
91107
git diff -a

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A central manifest of specs with descriptions and accounts of their various mode
117117
| 100 | Simplified Fast Paxos | <a href="https://github.com/tlaplus/Examples/tree/master/specifications/SimplifiedFastPaxos">Simplified version of Fast Paxos (Lamport, 2006)</a> | Lim Ngian Xin Terry, Gaurav Gandhi | |&#10004;| TLC, Naturals, FiniteSets, Integers | | |
118118
| 101 | Learn TLA⁺ Proofs | <a href="specifications/LearnProofs">Basic PlusCal algorithms and formal proofs of their correctness</a> | Andrew Helwer | &#10004; | &#10004; | Sequences, Naturals, Integers, TLAPS | &#10004; | |
119119
| 102 | Lexicographically-Least Circular Substring | <a href="specifications/LeastCircularSubstring">Booth's 1980 algorithm to find the lexicographically-least circular substring</a> | Andrew Helwer | | &#10004; | FiniteSets, Integers, Naturals, Sequences | &#10004; | |
120-
| 103 | Distributed Checkpoint Coordination | <a href="specifications/LeastCircularSubstring">Algorithm for coordinating checkpoint/snapshot leases in a Paxos ring</a> | Andrew Helwer | | &#10004; | FiniteSets, Naturals, Sequences, TLC | | |
120+
| 103 | Distributed Checkpoint Coordination | <a href="specifications/CheckpointCoordination">Algorithm for coordinating checkpoint/snapshot leases in a Paxos ring</a> | Andrew Helwer | | &#10004; | FiniteSets, Naturals, Sequences, TLC | | |
121121

122122
## License
123123

@@ -146,10 +146,11 @@ To do this, you'll have to update the [`manifest.json`](manifest.json) file with
146146
If this process doesn't work for you, you can alternatively modify the [`.ciignore`](.ciignore) file to exclude your spec from validation.
147147
Otherwise, follow these directions:
148148

149-
1. Ensure you have Python 3.X installed
149+
1. Ensure you have Python 3.11+ installed
150150
1. Download & extract tree-sitter-tlaplus ([zip](https://github.com/tlaplus-community/tree-sitter-tlaplus/archive/refs/heads/main.zip), [tar.gz](https://github.com/tlaplus-community/tree-sitter-tlaplus/archive/refs/heads/main.tar.gz)) to the root of the repository; ensure the extracted folder is named `tree-sitter-tlaplus`
151151
1. Open a shell and navigate to the repo root; ensure a C++ compiler is installed and on your path
152152
- On Windows, this might entail running the below script from the visual studio developer command prompt
153+
1. It is considered best practice to create & initialize a Python virtual environment to preserve your system package store; run `python -m venv .` then `source ./bin/activate` on Linux & macOS or `.\Scripts\activate.bat` on Windows (run `deactivate` to exit)
153154
1. Run `pip install -r .github/scripts/requirements.txt`
154155
1. Run `python .github/scripts/generate_manifest.py`
155156
1. Locate your spec's entry in the [`manifest.json`](manifest.json) file and ensure the following fields are filled out:

manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,8 +1335,8 @@
13351335
"description": "Spec of simplified Fast Paxos from Lamport's 2006 paper Fast Paxos",
13361336
"source": "",
13371337
"authors": [
1338-
"Lim Ngian Xin Terry",
1339-
"Gaurav Gandhi"
1338+
"Gaurav Gandhi",
1339+
"Lim Ngian Xin Terry"
13401340
],
13411341
"tags": [],
13421342
"modules": [
@@ -3654,4 +3654,4 @@
36543654
]
36553655
}
36563656
]
3657-
}
3657+
}

0 commit comments

Comments
 (0)