Skip to content

Commit ea06e16

Browse files
authored
Merge pull request #14 from BuildingSync/feat/support-bsync-2.4
Upgrade to BuildingSync Version 2.4
2 parents 9c980e8 + 33dbda7 commit ea06e16

File tree

13 files changed

+2622
-3350
lines changed

13 files changed

+2622
-3350
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@ jobs:
2424
- name: Install poetry
2525
uses: abatilo/actions-poetry@v2.0.0
2626

27-
- name: Install poetry and pre-commit
27+
- name: Install poetry (and update) and pre-commit
2828
run: |
29-
poetry install
29+
poetry update
3030
poetry run pre-commit install
3131
3232
- name: Run pre-commit
3333
run: poetry run pre-commit run --all-files
3434

35-
3635
- name: Run tests
37-
run: poetry run pytest
36+
run: poetry run pytest
37+
38+
- name: Run Generator (BuildingSync 2.4)
39+
run: |
40+
curl -L -o bsyncpy/BuildingSync-2.4.xsd https://github.com/BuildingSync/schema/releases/download/v2.4.0/BuildingSync.xsd
41+
cd bsyncpy
42+
poetry run python bsyncpy_generator.py BuildingSync-2.4.xsd

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.python-version
22
.idea
3+
.vscode
34
.DS_Store
45
__pycache__
56
*.egg-info

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Version 0.2.0 (Unreleased)
2+
3+
* Generated for BuildingSync 2.4
4+
* Renamed project folder to bsyncpy to follow Python package conventions
5+
* Updated Poetry/Python dependencies
6+
17
# Version 0.1.1
28

39
* Updated dependencies and regenerated bsync.py

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
![Build Status](https://github.com/BuildingSync/bsyncpy/actions/workflows/ci.yml/badge.svg?branch=develop)
44

5-
Currently generated by BuildingSync version:
6-
- `2.3.0`
5+
Current BuildingSync version: `2.4.0`.
76

87
## Generating
98
- `poetry install`
109
- `poetry run pre-commit install`
11-
- Download, copy, or curl a BuildingSync schema into `bsyncpy/bsync`
12-
- `curl -L -o bsync/BuildingSync-2.3.xsd https://github.com/BuildingSync/schema/releases/download/v2.3.0/BuildingSync.xsd`
13-
- cd into `bsyncpy/bsync`
14-
- Run generator: `poetry run python bsyncpy_generator.py BuildingSync-2.3.xsd`
15-
- Go back to `bsyncpy` and run tests: `poetry run pytest`
10+
- Download, copy, or curl a BuildingSync schema into `bsyncpy/bsyncpy`
11+
- `curl -L -o bsyncpy/BuildingSync-2.4.xsd https://github.com/BuildingSync/schema/releases/download/v2.4.0/BuildingSync.xsd`
12+
- cd into `bsyncpy/bsyncpy`
13+
- Run generator: `poetry run python bsyncpy_generator.py BuildingSync-2.4.xsd`
14+
- Go back to the root `bsyncpy` and run tests: `poetry run pytest`
1615
- Make sure formatting is good: `poetry run pre-commit run --all-files`
1716
- On commit, pre-commit should run again
1817

@@ -21,11 +20,11 @@ Currently generated by BuildingSync version:
2120
*Input*
2221
```python
2322
from lxml import etree
24-
from bsync import bsync
23+
from bsyncpy import bsync
2524

2625
# Create a root and set the version attribute
2726
root = bsync.BuildingSync()
28-
root.set('version', '2.3.0')
27+
root.set('version', '2.4.0')
2928

3029
# Valid element attributes can also be passed in as kwargs
3130
f = bsync.Facilities(bsync.Facilities.Facility(ID='Facility-1'))
@@ -42,7 +41,7 @@ with open('output.xml', 'wb+') as f:
4241
*Output*
4342
```xml
4443
<?xml version="1.0" encoding="UTF-8"?>
45-
<BuildingSync version="2.3.0">
44+
<BuildingSync version="2.4.0">
4645
<Facilities>
4746
<Facility ID="Facility-1"/>
4847
</Facilities>
@@ -52,3 +51,12 @@ with open('output.xml', 'wb+') as f:
5251
## Comprehensive example
5352

5453
Check out our example Jupyter Notebook [here](https://nbviewer.jupyter.org/github/BuildingSync/schema/blob/develop-v2/docs/notebooks/bsync_examples/Small-Office-Level-1.ipynb).
54+
55+
56+
# Updating Version
57+
58+
* See the notes above on downloading and generating the new bsync.py file.
59+
* Bump version in `pyproject.toml` file
60+
* Add CHANGELOG entry
61+
* Update (or add) generator test in `.github/ci.yml`
62+
* Update this README with the latest version of testing.
File renamed without changes.

0 commit comments

Comments
 (0)