Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
groups:
python-deps:
patterns:
- "*"
commit-message:
prefix: "deps"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions-deps:
patterns:
- "*"
commit-message:
prefix: "ci"
88 changes: 44 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
name: CI

on: [push]
on:
pull_request:
push:

jobs:
tests:
name: Run tests with Poetry
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0

- name: Install poetry (and update) and pre-commit
run: |
poetry update
poetry run pre-commit install

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
- name: Install dependencies
run: poetry install --no-interaction
- name: Run pre-commit
run: poetry run pre-commit run --all-files

- name: Run tests
run: poetry run pytest

- name: Run Generator (BuildingSync 2.3)
run: |
curl -L -o bsyncpy/BuildingSync-2.3.xsd https://github.com/BuildingSync/schema/releases/download/v2.3.0/BuildingSync.xsd
cd bsyncpy
poetry run python bsyncpy_generator.py BuildingSync-2.3.xsd

- name: Run Generator (BuildingSync 2.4)
run: |
curl -L -o bsyncpy/BuildingSync-2.4.xsd https://github.com/BuildingSync/schema/releases/download/v2.4.0/BuildingSync.xsd
cd bsyncpy
poetry run python bsyncpy_generator.py BuildingSync-2.4.xsd

- name: Run Generator (BuildingSync 2.5)
run: |
curl -L -o bsyncpy/BuildingSync-2.5.xsd https://github.com/BuildingSync/schema/releases/download/v2.5.0/BuildingSync.xsd
cd bsyncpy
poetry run python bsyncpy_generator.py BuildingSync-2.5.xsd
generator:
name: Generator (BuildingSync ${{ matrix.schema.name }})
runs-on: ubuntu-latest

- name: Run Generator (BuildingSync Develop V2)
run: |
curl -L -o bsyncpy/BuildingSync-develop-v2.xsd https://raw.githubusercontent.com/BuildingSync/schema/develop-v2/BuildingSync.xsd
cd bsyncpy
poetry run python bsyncpy_generator.py BuildingSync-develop-v2.xsd
strategy:
fail-fast: false
matrix:
schema:
- { name: "2.3", url: "https://github.com/BuildingSync/schema/releases/download/v2.3.0/BuildingSync.xsd" }
- { name: "2.4", url: "https://github.com/BuildingSync/schema/releases/download/v2.4.0/BuildingSync.xsd" }
- { name: "2.5", url: "https://github.com/BuildingSync/schema/releases/download/v2.5.0/BuildingSync.xsd" }
- { name: "2.6", url: "https://github.com/BuildingSync/schema/releases/download/v2.6.0/BuildingSync.xsd" }
- { name: "2.7", url: "https://github.com/BuildingSync/schema/releases/download/v2.7.0/BuildingSync.xsd" }
- { name: "develop-v2", url: "https://raw.githubusercontent.com/BuildingSync/schema/develop-v2/BuildingSync.xsd" }
- { name: "develop-v3", url: "https://raw.githubusercontent.com/BuildingSync/schema/develop-v3/BuildingSync.xsd" }

- name: Run Generator (BuildingSync Develop V3)
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
- name: Install dependencies
run: poetry install --no-interaction
- name: Run generator
working-directory: bsyncpy
run: |
curl -L -o bsyncpy/BuildingSync-develop-v3.xsd https://raw.githubusercontent.com/BuildingSync/schema/develop-v3/BuildingSync.xsd
cd bsyncpy
poetry run python bsyncpy_generator.py BuildingSync-develop-v3.xsd
curl -fsSL -o BuildingSync-test.xsd "${{ matrix.schema.url }}"
poetry run python bsyncpy_generator.py BuildingSync-test.xsd
poetry run python -c "import bsync; bsync.BuildingSync()"
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 26.10.1
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Version 0.4.0

* Generated for BuildingSync 2.7.0 (52 new elements, none removed), including:
* Condition elements for envelope, HVAC, lighting, and other systems
* Files / LinkedFiles and related file metadata elements
* Federal facility identifiers (FederalFacility, FacilityNumber, SubAgency, ...)
* Life-cycle savings elements (LifeCycleSavingsEnergy, LifeCycleSavingsWater, ...)
* AuditCycleStartDate / AuditCycleEndDate
* Require Python 3.11+ (tested on 3.11, 3.12, 3.13, and 3.14)
* Allow lxml 5 and 6 (previously limited to lxml 4, which has no wheels for Python 3.13+)
* Moved packaging metadata to the standard `[project]` table (Poetry 2)
* Updated CI (Python matrix, generator checks for BuildingSync 2.3 through 2.7 and develop branches) and added Dependabot
* Updated black to 26.10.1

# Version 0.3.0

* Generated for BuildingSync 2.5 (which is currently develop-v2)
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

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

Current BuildingSync version: `2.5.0`.
Current BuildingSync version: `2.7.0`.

Supported Python versions: 3.11, 3.12, 3.13, and 3.14.

## Installing

Expand All @@ -12,9 +14,9 @@ Current BuildingSync version: `2.5.0`.
- `poetry install`
- `poetry run pre-commit install`
- Download, copy, or curl a BuildingSync schema into `bsyncpy/bsyncpy`
- `curl -L -o bsyncpy/BuildingSync-2.5.xsd https://github.com/BuildingSync/schema/releases/download/v2.5.0/BuildingSync.xsd`
- `curl -L -o bsyncpy/BuildingSync-2.7.xsd https://github.com/BuildingSync/schema/releases/download/v2.7.0/BuildingSync.xsd`
- cd into `bsyncpy/bsyncpy`
- Run generator: `poetry run python bsyncpy_generator.py BuildingSync-2.5.xsd`
- Run generator: `poetry run python bsyncpy_generator.py BuildingSync-2.7.xsd`
- Go back to the root `bsyncpy` and run tests: `poetry run pytest`
- Make sure formatting is good: `poetry run pre-commit run --all-files`
- On commit, pre-commit should run again
Expand All @@ -28,7 +30,7 @@ from bsyncpy import bsync

# Create a root and set the version attribute
root = bsync.BuildingSync()
root.set('version', '2.5.0')
root.set('version', '2.7.0')

# Valid element attributes can also be passed in as kwargs
f = bsync.Facilities(bsync.Facilities.Facility(ID='Facility-1'))
Expand All @@ -45,7 +47,7 @@ with open('output.xml', 'wb+') as f:
*Output*
```xml
<?xml version="1.0" encoding="UTF-8"?>
<BuildingSync version="2.5.0">
<BuildingSync version="2.7.0">
<Facilities>
<Facility ID="Facility-1"/>
</Facilities>
Expand All @@ -54,15 +56,15 @@ with open('output.xml', 'wb+') as f:

## Comprehensive example

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).
Check out the example Jupyter notebooks in the BuildingSync schema repository: [docs/notebooks](https://github.com/BuildingSync/schema/tree/develop-v2/docs/notebooks).


# Updating Version

* See the notes above on downloading and generating the new bsync.py file.
* Bump version in `pyproject.toml` file
* Add/update CHANGELOG entry
* Update (or add) generator test in `.github/ci.yml`
* Add the new release to the generator matrix in `.github/workflows/ci.yml`
* Update this README with the latest version of testing.

## Releasing New Version
Expand Down
Loading
Loading