Repository navigation
Modernizing packaging to Poetry, and automate publishing to PyPI #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e3358e6
bump pre-commit hook versions with `poetry run pre-commit autoupdate`
vtnate 69246eb
replace setup.py with pyproject.toml
vtnate ad554ef
update ruff pre-commit hook in anticipation of it being used
vtnate 035b9e1
automated publishing to pypi on github release
vtnate ad82568
add ruff_cache to gitignore
vtnate 3087229
update ci to work with poetry
vtnate 953ff44
add mypy to dev deps, and set min python for it to 3.10
vtnate 6f42735
prep for mypy in CI, but don't actually use it yet
vtnate 1045750
update dependencies
vtnate 1c70b5c
remove copypasta docker check from CI workflow
vtnate 88abe0f
include Kat as author, and point to nrel repo
vtnate c751728
revert to supporting python >3.9,<3.13
vtnate 7d951ca
also support python 3.13
vtnate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,3 +111,6 @@ data/* | |
|
|
||
| # PyCharm | ||
| .idea | ||
|
|
||
| # Ruff | ||
| .ruff-cache/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| [mypy] | ||
| python_version = "3.9" | ||
| python_version = "3.10" | ||
| ignore_missing_imports = True | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
|
vtnate marked this conversation as resolved.
|
||
| ] | ||
|
|
||
| packages = [ | ||
| { include = "buildingid" }, | ||
| ] | ||
|
|
||
| [tool.poetry.dependencies] | ||
| python = ">=3.10,<3.14" | ||
|
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" | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stick with 3.9...