Skip to content

Commit d238320

Browse files
authored
Merge pull request #149 from BerkeleyLearnVerify/3.x
Scenic 3 public release
2 parents ee56a11 + 88dcce5 commit d238320

File tree

501 files changed

+48623
-31376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

501 files changed

+48623
-31376
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .git-blame-ignore-revs
2+
# Ran isort and black on the whole codebase
3+
360c67fab09d172498b3014510ee3658643d12da
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: format
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_call:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Run black to check formatting
16+
uses: psf/black@stable
17+
18+
- name: Run isort to check import order
19+
uses: isort/isort-action@v1

.github/workflows/run-tests.yml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,73 @@ on:
2626
type: string
2727

2828
jobs:
29-
build:
29+
check-format:
30+
uses: ./.github/workflows/check-formatting.yml
31+
32+
test:
3033
strategy:
3134
fail-fast: true
3235
matrix:
33-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
36+
python-version: ["3.8", "3.9", "3.10", "3.11"]
3437
os: [ubuntu-latest, windows-latest]
3538
runs-on: ${{ matrix.os }}
39+
3640
steps:
3741
- name: Checkout given ref
3842
uses: actions/checkout@v3
3943
if: inputs.ref != ''
4044
with:
4145
ref: ${{ inputs.ref }}
46+
4247
- name: Checkout current branch
4348
uses: actions/checkout@v3
4449
if: inputs.ref == ''
4550
with:
4651
ref: ${{ github.ref }}
52+
53+
- name: Install non-Python dependencies (Linux)
54+
if: ${{ matrix.os == 'ubuntu-latest' }}
55+
uses: awalsh128/cache-apt-pkgs-action@latest
56+
with:
57+
packages: blender openscad
58+
59+
- name: Restore cached non-Python dependencies (Windows)
60+
id: windows-cache-deps
61+
if: ${{ matrix.os == 'windows-latest' }}
62+
uses: actions/cache@v3
63+
with:
64+
path: downloads
65+
key: windows-deps
66+
67+
- name: Download non-Python dependencies (Windows)
68+
if: ${{ matrix.os == 'windows-latest' && steps.windows-cache-deps.outputs.cache-hit != 'true' }}
69+
run: |
70+
New-Item -Path downloads -ItemType Directory -Force
71+
Invoke-WebRequest https://files.openscad.org/OpenSCAD-2021.01-x86-64.zip -O downloads/openscad.zip
72+
Invoke-WebRequest https://download.blender.org/release/Blender3.6/blender-3.6.0-windows-x64.zip -O downloads/blender.zip
73+
74+
- name: Install non-Python dependencies (Windows)
75+
if: ${{ matrix.os == 'windows-latest' }}
76+
run: |
77+
Expand-Archive -Path downloads/openscad.zip -DestinationPath openscad
78+
Move-Item -Path openscad/openscad-2021.01 -Destination $Env:Programfiles\OpenSCAD
79+
Expand-Archive -Path downloads/blender.zip -DestinationPath blender
80+
Move-Item -Path blender/blender-3.6.0-windows-x64 -Destination "$Env:Programfiles\Blender Foundation\Blender"
81+
4782
- name: Set up Python ${{ matrix.python-version }}
4883
uses: actions/setup-python@v4
4984
with:
5085
python-version: ${{ matrix.python-version }}
86+
cache: 'pip'
87+
5188
- name: Update pip
5289
run: |
5390
python -m pip install --upgrade pip
91+
5492
- name: Install Scenic and dependencies
5593
run: |
5694
python -m pip install -e ".[test]"
95+
5796
- name: Run pytest
5897
run: |
5998
pytest ${{ inputs.options || '--no-graphics' }}

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ celerybeat-schedule
110110
.env
111111
.venv
112112
env/
113-
venv/
113+
venv*/
114114
ENV/
115115
env.bak/
116116
venv.bak/
117+
scenic.venv/
117118

118119
# Spyder project settings
119120
.spyderproject
@@ -131,3 +132,6 @@ venv.bak/
131132
dmypy.json
132133

133134
*.cproject
135+
136+
# generated parser
137+
src/scenic/syntax/parser.py

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 23.3.0
4+
hooks:
5+
- id: black
6+
language_version: python3.11
7+
8+
- repo: https://github.com/pycqa/isort
9+
rev: 5.12.0
10+
hooks:
11+
- id: isort

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
GRAMMAR = ./src/scenic/syntax/scenic.gram
2+
PARSER = ./src/scenic/syntax/parser.py
3+
4+
.PHONY: all
5+
all: $(PARSER)
6+
7+
$(PARSER): $(GRAMMAR)
8+
python -m pegen $(GRAMMAR) -o $(PARSER)
9+
10+
format:
11+
isort .
12+
black .
13+
14+
.PHONY: clean
15+
clean:
16+
-rm $(PARSER)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)