diff --git a/.github/workflows/build-calitp-data-analysis.yml b/.github/workflows/build-calitp-data-analysis.yml index 6fc64862df..8acdda5ab0 100644 --- a/.github/workflows/build-calitp-data-analysis.yml +++ b/.github/workflows/build-calitp-data-analysis.yml @@ -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: diff --git a/.github/workflows/build-calitp-data-infra.yml b/.github/workflows/build-calitp-data-infra.yml index fd3d9164b9..edcdb8a0a9 100644 --- a/.github/workflows/build-calitp-data-infra.yml +++ b/.github/workflows/build-calitp-data-infra.yml @@ -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: diff --git a/docs/analytics_tools/python_libraries.md b/docs/analytics_tools/python_libraries.md index 1eabc83651..2bf02c6e8c 100644 --- a/docs/analytics_tools/python_libraries.md +++ b/docs/analytics_tools/python_libraries.md @@ -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 ` 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/) diff --git a/packages/README.md b/packages/README.md index bc000ab6a2..bdff13ec7e 100644 --- a/packages/README.md +++ b/packages/README.md @@ -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.