Skip to content
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

PyPI Package Release Steps Edits #3248

Merged
merged 3 commits into from
Feb 5, 2024
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/build-calitp-data-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
- 'main'
paths:
- '.github/workflows/build-calitp-data-analysis.yml'
- 'packages/calitp-data-analysis/pyproject.toml'
- 'packages/calitp-data-analysis/calitp_data_analysis/**'
pull_request:
paths:
- '.github/workflows/build-calitp-data-analysis.yml'
- 'packages/calitp-data-analysis/pyproject.toml'
- 'packages/calitp-data-analysis/calitp_data_analysis/**'

concurrency:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-calitp-data-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
- 'main'
paths:
- '.github/workflows/build-calitp-data-infra.yml'
- 'packages/calitp-data-infra/pyproject.toml'
- 'packages/calitp-data-infra/calitp_data_infra/**'
pull_request:
paths:
- '.github/workflows/build-calitp-data-infra.yml'
- 'packages/calitp-data-infra/pyproject.toml'
- 'packages/calitp-data-infra/calitp_data_infra/**'

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion docs/analytics_tools/python_libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ While most Python packages an analyst uses come in JupyterHub, there may be addi

Adapted from [this Slack thread](https://cal-itp.slack.com/archives/C02KH3DGZL7/p1694470040574809).

1. Make the changes you want in the `calitp-data-analysis` folder inside `packages` [here](https://github.com/cal-itp/data-infra/tree/main/packages/calitp-data-analysis).
1. Make the changes you want in the `calitp-data-analysis` folder inside `packages` [here](https://github.com/cal-itp/data-infra/tree/main/packages/calitp-data-analysis). If you are only changing package metadata (author information, package description, etc.) without changing the function of the package itself, that information lives in `pyproject.toml` rather than in the `calitp-data-analysis` subfolder.
- If you are adding a new function that relies on a package that isn't already a dependency, run `poetry add <package name>` after changing directories to `data-infra/packages/calitp_data_analysis`. Check this [Jupyter image file](https://github.com/cal-itp/data-infra/blob/main/images/jupyter-singleuser/pyproject.toml) for the version number associated with the package, because you should specify the version.
- For example, your function relies on `dask`. In the Jupyter image file, the version is `dask = "~2022.8"` so run `poetry add dask==~2022.8` in the terminal.
- You may also have run `poetry install mypy`. `mypy` is a package that audits all the functions. [Read more about it here.](https://mypy-lang.org/)
Expand Down
2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ number of tests. These checks are executed in GitHub Actions when a PR is opened

## Deploying Changes to Production

When changes are finalized, a new version number should be specified in the relevant package's [pyproject.toml](./pyproject.toml) file. When changes to the package directory are merged into `main`, the relevant GitHub Action (`build-calitp-data-analysis` or `build-calitp-data-infra`) automatically publishes an updated version of the package to PyPI. A contributor with proper PyPI permissions can also manually release a new version of the targeted package via the CLI, or test a release using [TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/). To obtain those permissions, the owner of the PyPI project must grant your PyPI account Maintainer status through the project's Manage pane on [the PyPI website](https://pypi.org/).
When changes are finalized, including changes to the list of requirements for a package, a new version number should be specified in the relevant package's [pyproject.toml](./pyproject.toml) file. When changes to the package directory are merged into `main`, the relevant GitHub Action (`build-calitp-data-analysis` or `build-calitp-data-infra`) automatically publishes an updated version of the package to PyPI. A contributor with proper PyPI permissions can also manually release a new version of the targeted package via the CLI, or test a release using [TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/). To obtain those permissions, the owner of the PyPI project must grant your PyPI account Maintainer status through the project's Manage pane on [the PyPI website](https://pypi.org/).

After deploying, it is likely that changes will need to be made to `requirements.txt` files, Dockerfiles, and other place across the ecosystem where the previous package version number is referenced. Each of these places will have their own deployment needs.
Loading