Skip to content

Cleanup package infrastructure#60

Merged
brianhelba merged 2 commits intomasterfrom
cleanup
Mar 11, 2026
Merged

Cleanup package infrastructure#60
brianhelba merged 2 commits intomasterfrom
cleanup

Conversation

@brianhelba
Copy link
Member

No description provided.

@brianhelba brianhelba requested a review from danlamanna March 11, 2026 03:25
- name: Publish to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

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

I've deleted the PYPI_TOKEN secret from GH Actions. I assume that's set from your own PyPI account, so feel free to delete it there.

- name: Publish the Python distributions to PyPI
run: |
tox -e release
uv publish --trusted-publishing=always
Copy link
Member Author

Choose a reason for hiding this comment

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

I've setup the appropriate trusted publishing setup on PyPI just now, so this will be ready to publish. I've also setup the release GH Actions environment.

@@ -0,0 +1,6 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
Copy link
Member Author

Choose a reason for hiding this comment

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

I've configured Renovate to run on this repo, once this is merged.

Comment on lines -8 to -9
with contextlib.suppress(PackageNotFoundError):
__version__ = version("isic-metadata")
Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed __version__ outright. Many sources indicate that it's obsolete, given that importlib.metadata.version is available. Let me know if you think this is a problem.

Comment on lines +3 to +4
from isic_metadata.anatom_site_hierarchical import AnatomSiteEnum
from isic_metadata.diagnosis_hierarchical import DiagnosisEnum
Copy link
Member Author

Choose a reason for hiding this comment

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

Rather than trying to re-export these classes via isic_metadata.fields, everything is now available via isic_metadata.

However, things that import AnatomSiteEnum or DiagnosisEnum will need to be adjusted to import directly from isic_metadata. This is a breaking change.

name = "isic-metadata"
description = ""
readme = "README.md"
requires-python = ">=3.12"
Copy link
Member Author

Choose a reason for hiding this comment

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

We really need 3.12 for a lot of modern features.

dependency_groups =
lint
commands =
pytest --cov-report=html --cov-branch --cov=isic_metadata {posargs} tests
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, this no longer opts into branch coverage. I think it's nice in theory, but in practice, it has a lot of false positives. I skimmed through some of the actual HTML coverage reports with branch coverage enabled and I wasn't impressed.

However, I don't strongly object to turning it back on. Just add to pyproject.toml:

[tool.coverage.run]
branch = true

branches:
- master
schedule:
- cron: "0 0 * * *"
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think these nightly runs are helpful anymore, now that we have a lockfile. Plus, Renovate will be making PRs weekly.

@cache
def reverse_ordered_hierarchy(cls) -> list[str]:
return sorted(cls, key=lambda x: x.value.count(":"), reverse=True)
def reverse_ordered_hierarchy(cls) -> list[Self]:
Copy link
Member Author

Choose a reason for hiding this comment

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

Technically this is returning a list of AnatomSiteEnum instances.

@brianhelba brianhelba merged commit 510e68b into master Mar 11, 2026
3 checks passed
@brianhelba brianhelba deleted the cleanup branch March 11, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant