Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
54 changes: 54 additions & 0 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: PyPIRelease
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

on:
release:
types: [published]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi_release
url: https://pypi.org/p/buildingid-nrel/
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v5
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
36 changes: 17 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,27 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]
python-version: ["3.10", "3.13"]

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Install pre-commit
run: |
pip install pre-commit

- name: Run pre-commit hooks
- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "latest"
- name: Install dependencies with Poetry
# poetry setuptools workaround sourced from https://github.com/python-poetry/poetry/issues/7611#issuecomment-1711443539
run: |
pre-commit run --all-files --show-diff-on-failure

poetry --version
poetry self add setuptools
poetry install
- name: Run pre-commit
run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
# - name: Run mypy
# run: poetry run mypy --install-types --non-interactive --show-error-codes .
- name: Run tests with pytest
run: |
pytest tests/ --cov=buildingid --cov-report=xml --cov-report=term-missing
run: poetry run pytest tests/ --cov=buildingid --cov-report=xml --cov-report=term-missing
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ data/*

# PyCharm
.idea

# Ruff
.ruff-cache/
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=2000"]
Expand All @@ -27,9 +27,9 @@ repos:
# types_or: [yaml, markdown, css, scss]
# https://docs.astral.sh/ruff/integrations/#pre-commit
# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.12.1
# rev: v0.13.1
# hooks:
# - id: ruff
# - id: ruff-check
# args: [--fix, --exit-non-zero-on-fix, --output-format=full] #, --unsafe-fixes]
# exclude: buildingid/code_pattern.py
# - id: ruff-format
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[mypy]
python_version = "3.9"
python_version = "3.10"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nllong can we make this change now? I think SEED is still on 3.9...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be too hard to stick with 3.9. The original didn't have any versioning on dependencies, so I just set the current version of everything. I could enforce older versions of dependencies and that way support 3.9 again, though we might give up 3.13 in the process.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stick with 3.9...

ignore_missing_imports = True
1,108 changes: 1,108 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

59 changes: 51 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.mypy]
python_version = "3.9"
ignore_missing_imports = true
[tool.ruff]
line-length = 120
requires = ["poetry-core>=2.0.1"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "buildingid-nrel"
version = "0.1.0"
description = "Unique Building Identifier (UBID)"
readme = "README.rst"
authors = [
"Mark Borkum <mark.borkum@pnnl.gov>",
"Nicholas Long <nicholas.long@nrel.gov>",
"Katherine Fleming <katherine.fleming@nrel.gov>",
]
license = "BSD-2-Clause"
homepage = "https://github.com/SEED-platform/buildingid-nrel"
repository = "https://github.com/SEED-platform/buildingid-nrel"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: GIS",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Comment thread
vtnate marked this conversation as resolved.
]

packages = [
{ include = "buildingid" },
]

[tool.poetry.dependencies]
python = ">=3.10,<3.14"
Comment thread
vtnate marked this conversation as resolved.
Outdated
click = "^8.2"
click_log = "^0.4.0"
openlocationcode = "^1.0"
pandas = ">=2.2.2,<3"
pyqtree = "^1.0"
shapely = "^2.1"
tqdm = "^4.67"

[tool.poetry.group.dev.dependencies]
check-manifest = "^0.50.0"
coverage = "^7.10"
pytest = "^8.4"
pytest-cov = "^7.0.0"
pre-commit = "^4.3"
mypy = "^1.17"

[tool.poetry.scripts]
buildingid = "buildingid.command_line:cli"
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

80 changes: 0 additions & 80 deletions setup.py

This file was deleted.