Skip to content

Commit 264cadd

Browse files
authored
Merge pull request #626 from ActivitySim/main
Develop got out of sync with main
2 parents dda6bd9 + 1e4ffc5 commit 264cadd

File tree

3 files changed

+107
-67
lines changed

3 files changed

+107
-67
lines changed

.github/workflows/deployment.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,58 @@ jobs:
7575
repository_url: https://test.pypi.org/legacy/
7676
verbose: true
7777

78+
docbuild:
79+
needs: test-built-dist
80+
if: github.event_name == 'release'
81+
name: ubuntu-latest py3.9
82+
runs-on: ubuntu-latest
83+
defaults:
84+
run:
85+
shell: bash -l {0}
86+
steps:
87+
- uses: actions/checkout@v3
88+
- uses: actions/download-artifact@v3
89+
with:
90+
name: releases
91+
path: dist
92+
- name: Set up Python 3.9
93+
uses: actions/setup-python@v2
94+
with:
95+
python-version: 3.9
96+
- name: Install dependencies
97+
uses: conda-incubator/setup-miniconda@v2
98+
with:
99+
miniforge-variant: Mambaforge
100+
miniforge-version: latest
101+
use-mamba: true
102+
environment-file: conda-environments/docbuild.yml
103+
python-version: 3.9
104+
activate-environment: docbuild
105+
auto-activate-base: false
106+
auto-update-conda: false
107+
- name: Install activitysim
108+
run: |
109+
python -m pip install dist/activitysim-*.whl
110+
- name: Conda checkup
111+
run: |
112+
conda info -a
113+
conda list
114+
echo REPOSITORY ${{ github.repository }}
115+
echo REF ${{ github.ref }}
116+
echo REF_NAME ${{ github.ref_name }}
117+
- name: Build the docs
118+
run: |
119+
cd docs
120+
make clean
121+
make html
122+
- name: Push to GitHub Pages
123+
uses: peaceiris/[email protected]
124+
with:
125+
github_token: ${{ secrets.GITHUB_TOKEN }}
126+
# Token is created automatically by Github Actions, no other config needed
127+
publish_dir: ./docs/_build/html
128+
destination_dir: ${{ github.ref_name }}
129+
78130
upload-to-pypi:
79131
needs: test-built-dist
80132
if: github.event_name == 'release'
@@ -89,4 +141,4 @@ jobs:
89141
with:
90142
user: __token__
91143
password: ${{ secrets.PYPI_TOKEN }}
92-
verbose: true
144+
verbose: true

HOW_TO_RELEASE.md

Lines changed: 47 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
01. Check that the branch you intend to release is passing tests on Travis.
66
If it's not passing there you should not release it.
77

8-
00. Start from a completely clean conda environment
9-
and git repository. Assuming you have `conda` installed, you can do so
10-
by starting where ActivitySim is not yet cloned (e.g. in an empty
8+
00. Start from a completely clean conda environment
9+
and git repository. Assuming you have `conda` installed, you can do so
10+
by starting where ActivitySim is not yet cloned (e.g. in an empty
1111
directory) and running:
1212
```sh
1313
conda create -n TEMP-ASIM-DEV python=3.9 git gh -c conda-forge --override-channels
@@ -19,7 +19,7 @@
1919

2020
00. Per project policy, code on the main branch should have been released,
2121
but if you are *preparing* a release then the code should be on the `develop`
22-
branch. Switch to that branch now, and make sure it is synced to the
22+
branch. Switch to that branch now, and make sure it is synced to the
2323
version on GitHub:
2424
```sh
2525
git switch develop
@@ -28,45 +28,46 @@
2828

2929
00. Update your Conda environment for testing. We do not want to use an
3030
existing environment on your machine, as it may be out-of-date
31-
and we want to make sure everything passes muster using the
31+
and we want to make sure everything passes muster using the
3232
most up-to-date dependencies available. The following command
33-
will update the active environment (we made this to be `TEMP-ASIM-DEV`
33+
will update the active environment (we made this to be `TEMP-ASIM-DEV`
3434
if you followed the directions above).
3535
```sh
3636
conda env update --file=conda-environments/activitysim-dev.yml
3737
```
38-
If you add to the ActivitySim dependencies, make sure to also update
39-
the environments in `conda-environments`, which are used for testing
40-
and development. If they are not updated, these environments will end
38+
If you add to the ActivitySim dependencies, make sure to also update
39+
the environments in `conda-environments`, which are used for testing
40+
and development. If they are not updated, these environments will end
4141
up with dependencies loaded from *pip* instead of *conda-forge*.
4242

43-
00. Run pycodestyle to ensure that the codebase passes all style checks.
43+
00. Run `black` to ensure that the codebase passes minimal style checks.
4444
This check should only take a few seconds. These checks are also done on
45-
Travis and are platform independent, so they should not be necessary to
45+
GitHub Actions and are platform independent, so they should not be necessary to
4646
replicate locally, but are listed here for completeness.
4747
```sh
48-
pycodestyle .
48+
black --check --diff .
4949
```
5050

51-
00. Run the regular test suite on Windows. Travis tests are done on Linux,
52-
but most users are on Windows, and the test suite should also be run
53-
on Windows to ensure that it works on that platform as well. If you
51+
00. Run the regular test suite on Windows. Most GitHub Actions tests are done on Linux,
52+
Linux (it's faster to start up and run a new clean VM for testing) but most
53+
users are on Windows, and the test suite should also be run on Windows to
54+
ensure that it works on that platform as well. If you
5455
are not preparing this release on Windows, you should be sure to run
55-
at least through this step on a Windows machine before finalizing a
56-
release.
57-
58-
A few of the tests require pre-created data that is not included in the
59-
repository directly, but rather recreated on the fly before testing. The
60-
regular test suite takes some time to run, between about half an hour and
56+
at least through this step on a Windows machine before finalizing a
57+
release.
58+
59+
A few of the tests require pre-created data that is not included in the
60+
repository directly, but rather recreated on the fly before testing. The
61+
regular test suite takes some time to run, between about half an hour and
6162
two hours depending on the specs of your machine.
6263
```sh
6364
python activitysim/examples/placeholder_multiple_zone/scripts/two_zone_example_data.py
6465
python activitysim/examples/placeholder_multiple_zone/scripts/three_zone_example_data.py
6566
pytest .
6667
```
67-
68+
6869
00. Test the full-scale regional examples. These examples are big, too
69-
large to run on Travis, and will take a lot of time (many hours) to
70+
large to run on GitHub Actions, and will take a lot of time (many hours) to
7071
download and run.
7172
```sh
7273
mkdir tmp-asim
@@ -76,68 +77,41 @@
7677
call run_all_examples.bat
7778
```
7879
These tests will run through the gamut even if some of them crash, so
79-
if you don't sit and watch them go (please don't do this) you'll need
80+
if you don't sit and watch them go (please don't do this) you'll need
8081
to scan through the results to make sure there are no errors after the
8182
fact.
8283
```sh
8384
python ../activitysim/examples/scan_examples_for_errors.py .
8485
```
8586

8687
00. Test the notebooks in `activitysim/examples/prototype_mtc/notebooks`.
87-
There are also demo notebooks for estimation, but their functionality
88+
There are also demo notebooks for estimation, but their functionality
8889
is completely tested in the unit tests run previously.
8990

90-
00. Use bump2version to tag the release commit and update the
91-
version number. The following code will generate a "patch" release,
92-
incrementing the third value in the version number (i.e. "1.2.3"
93-
becomes "1.2.4"). Alternatively, make a "minor" or "major" release.
94-
The `--list` command will generate output to your console to confirm
95-
that the old and new version numbers are what you expect, before you
96-
push the commit (with the changed version in the code) and tags to
97-
GitHub.
98-
```sh
99-
bump2version patch --list
100-
```
101-
102-
It is also possible to make a development pre-release. To do so,
103-
explicitly set the version number to the next patch plus a ".devN"
104-
suffix:
105-
106-
```sh
107-
bump2version patch --new-version 1.2.3.dev0 --list
108-
```
109-
110-
Then, when ready to make a "final" release, set the version by
111-
explicitly removing the suffix:
112-
```sh
113-
bump2version patch --new-version 1.2.3 --list
114-
```
115-
116-
00. Push the tagged commit to GitHub.
117-
```sh
118-
git push --tags
119-
```
120-
121-
00. For non-development releases, open a pull request to merge the proposed
122-
release into main. The following command will open a web browser for
91+
00. For non-development releases, open a pull request to merge the proposed
92+
release into main. The following command will open a web browser for
12393
you to create the pull request.
12494
```sh
12595
gh pr create --web
12696
```
12797
After creating the PR, confirm with the ActivitySim PMC that the release
12898
is ready before actually merging it.
129-
99+
130100
Once final approval is granted, merge the PR into main. The presence
131101
of the git tags added earlier will trigger automated build steps to
132102
prepare and deploy the release to pypi and conda-forge.
133-
103+
134104
00. Create a "release" on GitHub.
135105
```sh
136106
gh release create v1.2.3
137107
```
108+
The process of creating and tagging a release will automatically
109+
trigger various GitHub Actions scripts to build, test, and publish the
110+
new release to PyPI and conda forge, assuming there are no errors.
111+
138112
For a development pre-release, include the `--prerelease` argument.
139113
As the project's policy is that only formally released code is merged
140-
to the main branch, any pre-release should also be built against a
114+
to the main branch, any pre-release should also be built against a
141115
non-default branch. For example, to pre-release from the `develop`
142116
branch:
143117
```sh
@@ -147,11 +121,19 @@
147121
--notes "this pre-release is for a cool new feature" \
148122
--title "Development Pre-Release"
149123
```
150-
151-
00. Clean up your workspace, including removing the Conda environment used for
152-
testing (which will prevent you from accidentally using an old
124+
125+
00. Clean up your workspace, including removing the Conda environment used for
126+
testing (which will prevent you from accidentally using an old
153127
environment when you should have a fresh up-to-date one next time).
154128
```sh
155129
conda deactivate
156130
conda env remove -n TEMP-ASIM-DEV
157-
```
131+
```
132+
133+
00. Change the default redirect page for the ActivitySim documentation to point
134+
to the newly released documentation. The redirect page can be edited
135+
[here](https://github.com/ActivitySim/activitysim/blob/gh-pages/index.html).
136+
137+
00. Add the new release to the `switch.json` file. Don't delete the references
138+
for existing old documentation. The switcher can be edited
139+
[here](https://github.com/ActivitySim/activitysim/blob/gh-pages/switcher.json).

conda-environments/docbuild.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Environment for building docs
2+
#
3+
# This conda environment is used to build the documentation. It includes a
4+
# number of dependencies needed for the documentation only, and not to run or
5+
# test ActivitySim itself. Note that ActivitySim itself is *not* installed
6+
# in this environment, you must install it separately after using this recipe,
7+
# which allows you to install the specific version you want.
8+
29
name: docbuild
310
channels:
411
- conda-forge
@@ -43,4 +50,3 @@ dependencies:
4350

4451
- pip:
4552
- autodoc_pydantic
46-
- -e ..

0 commit comments

Comments
 (0)