From 461e7da4accee85b66f44a043ecce8e5e16f4719 Mon Sep 17 00:00:00 2001 From: tiffanychu90 Date: Wed, 7 Feb 2024 17:43:38 +0000 Subject: [PATCH] fix version in single user image --- docs/analytics_tools/python_libraries.md | 13 +++++++++---- docs/requirements.txt | 2 +- images/jupyter-singleuser/pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/analytics_tools/python_libraries.md b/docs/analytics_tools/python_libraries.md index 00887a834e..b324ef31aa 100644 --- a/docs/analytics_tools/python_libraries.md +++ b/docs/analytics_tools/python_libraries.md @@ -203,18 +203,23 @@ Adapted from [this Slack thread](https://cal-itp.slack.com/archives/C02KH3DGZL7/ - 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 Python files for information related to data types, and you can [read more about it here](https://mypy-lang.org/). - - `mypy` is one of the standard development dependencies for the `calitp-data-analysis package`, defined in the `pyproject.toml` file for the package, so to install it you can run `poetry install` in `packages/calitp-data-analysis/` (which will also install the other package dependencies). To use `mypy`, run `poetry run mypy [file or directory name you're interested in checking]`. - - `mypy` is generally run in CI when a PR is opened, as part of build tasks. You can see it called [here](https://github.com/cal-itp/data-infra/blob/main/.github/workflows/build-calitp-data-analysis.yml#L40) for this package in `build-calitp-data-analysis.yml`. Within the PR, the "Test, visualize, and build calitp-data-analysis" CI workflow will fail if problems are found. - - More helpful hints for [passing mypy in our repo](https://github.com/cal-itp/data-infra/blob/main/README.md#mypy). - + - `mypy` is one of the standard development dependencies for the `calitp-data-analysis package`, defined in the `pyproject.toml` file for the package, so to install it you can run `poetry install` in `packages/calitp-data-analysis/` (which will also install the other package dependencies). To use `mypy`, run `poetry run mypy [file or directory name you're interested in checking]`. + - `mypy` is generally run in CI when a PR is opened, as part of build tasks. You can see it called [here](https://github.com/cal-itp/data-infra/blob/main/.github/workflows/build-calitp-data-analysis.yml#L40) for this package in `build-calitp-data-analysis.yml`. Within the PR, the "Test, visualize, and build calitp-data-analysis" CI workflow will fail if problems are found. + - More helpful hints for [passing mypy in our repo](https://github.com/cal-itp/data-infra/blob/main/README.md#mypy). + 2. Each time you update the package, you must also update the version number. We use dates to reflect which version we are on. Update the version in [pyproject.toml](https://github.com/cal-itp/data-infra/blob/main/packages/calitp-data-analysis/pyproject.toml#L3) that lives in `calitp-data-analysis` to either today's date or a future date. + 3. Open a new pull request and make sure the new version date appears on the [test version page](https://test.pypi.org/project/calitp-data-analysis/). + - The new version date may not show up on the test page due to errors. Check the GitHub Action page of your pull request to see the errors that have occurred. - If you run into the error message like this, `error: Skipping analyzing "dask_geopandas": module is installed, but missing library stubs or py.typed marker [import]` go to your `.py` file and add `# type: ignore` behind the package import. - To fix the error above, change `import dask_geopandas as dg` to `import dask_geopandas as dg # type: ignore`. - It is encouraged to make changes in a set of smaller commits. For example, add all the necessary packages with `poetry run ` in a cell of Jupyter notebook and import a package (or two) such as `from calitp_data_analysis import styleguide`. + 5. Update the new version number in the `data-infra` repository [here](https://github.com/cal-itp/data-infra/blob/main/images/dask/requirements.txt#L30), [here](https://github.com/cal-itp/data-infra/blob/main/images/jupyter-singleuser/pyproject.toml#L48), [here](https://github.com/cal-itp/data-infra/blob/main/docs/requirements.txt), and anywhere else you find a reference to the old version of the package. You'll also want to do the same for any other Cal-ITP repositories that reference the calitp-data-analysis package. + - As of writing, the only other repository that references to the package version is [reports](https://github.com/cal-itp/reports). Resources diff --git a/docs/requirements.txt b/docs/requirements.txt index 9e838854bd..e6a13057ed 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,4 @@ jupyter-book==1.0.0 # Temporary pinning of pydata-sphinx-theme to workaround Sphinx 4.3.0 error # https://github.com/pydata/pydata-sphinx-theme/issues/508 pydata-sphinx-theme==0.7.2 -sphinxcontrib-mermaid==0.8.1 \ No newline at end of file +sphinxcontrib-mermaid==0.8.1 diff --git a/images/jupyter-singleuser/pyproject.toml b/images/jupyter-singleuser/pyproject.toml index e5c048363b..3da50a4f1c 100644 --- a/images/jupyter-singleuser/pyproject.toml +++ b/images/jupyter-singleuser/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jupyter-singleuser" -version = "2024.2.5" +version = "2024.2.6" description = "" authors = ["Soren Spicknall "]