Publish to PyPI as conflens on release - #26
Merged
Merged
Conversation
- pyproject: rename the distribution to `conflens` (import name/CLI unchanged), so `pip install conflens`; uv.lock re-locked. - release.yml: after the existing version bump + tag, build (`uv build`) and publish to PyPI with twine (`__token__` + PYPI_API_TOKEN secret), gated on a `released` output so it only runs when a new version was actually cut. Publishing lives in the release job because GITHUB_TOKEN-pushed tags don't trigger a separate tag-based workflow. `--skip-existing` keeps re-runs safe. - README: document `pip install conflens` and the PYPI_API_TOKEN secret.
- cli.py: load the .env from the current working directory via find_dotenv(usecwd=True). The old load_dotenv() searched from the installed package location, so a pip-installed `conflens` never picked up a .env next to where the user launched it (real env vars still work and take precedence). - tests/test_cli.py: .env-from-cwd is loaded, no-.env is a no-op, and a real env var overrides .env. - README: explain configuration (env var / .env in the run directory / in-app field, plus OpenReview creds) for the pip-installed CLI. - README badges: switch to PyPI stats (pypi version, pepy downloads, pypi pyversions) in place of the GitHub release/downloads/static-python badges.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Sets up automatic PyPI publishing (integrated into the existing release automation), makes the pip-installed CLI pick up a local
.env, and documents installation + configuration.Packaging verified:
uv build→ wheel + sdist with everyconflenssubmodule; installed into a clean Python 3.13 venv,conflens/conference-analyzerscripts work, imports resolve from site-packages, and the installedconflensboots the app (HTTP 200).Publishing
pyproject.toml— distribution renamed toconflens(both names were free on PyPI). Import name + CLI unchanged;pip install conflens.uv.lockre-locked..github/workflows/release.yml— after the existing bump + tag, the same job runsuv buildthenuvx twine upload --skip-existing dist/*(__token__/secrets.PYPI_API_TOKEN), gated on areleasedoutput so it only runs when a new version is cut. Publishing lives inside the release job becauseGITHUB_TOKEN-pushed tags don't trigger a separate tag-based workflow.Environment variables (installed CLI)
conflenstakes config three ways, in precedence order:export ANTHROPIC_API_KEY=…) — always work..envin the directory you launchconflensfrom — loaded automatically.Fix: the old
_load_env()calledload_dotenv(), which searches from the installed package location, so a pip-installedconflensnever picked up a.envin the user's working directory (only real env vars worked). Now it usesfind_dotenv(usecwd=True)to search the working directory. Real env vars still take precedence over.env. OpenReview creds (OPENREVIEW_TOKEN, orOPENREVIEW_USERNAME+OPENREVIEW_PASSWORD) work the same way or via the in-GUI fields.Docs
pip install conflensquick start; a Configuration section explaining env var /.env-in-run-dir / in-app field (+ OpenReview); thePYPI_API_TOKENsecret under Releasing.Testing
conflens0.1.13,conflens --helpworks.tests/test_cli.py:.env-from-cwd is loaded, no-.envis a no-op, real env var overrides.env.release.ymlvalid YAML; steps: Bump → Build → Publish.ruffclean ·pytest76 passed.conflensafterward).PYPI_API_TOKEN(Settings → Secrets and variables → Actions).Then the next merged PR bumps the version and publishes
conflensto PyPI automatically. (Happy to add a TestPyPIworkflow_dispatchdry-run if you want to validate the token before the first real release.)