Skip to content

Commit ec085e6

Browse files
author
Ben Stabler
authored
Merge pull request #463 from ActivitySim/develop
publish v1.0.2
2 parents a57efa1 + e0a6ef4 commit ec085e6

36 files changed

Lines changed: 3774 additions & 2565 deletions

.bumpversion.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[bumpversion]
2+
current_version = 1.0.2
3+
commit = True
4+
tag = True
5+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>.*))?
6+
serialize =
7+
{major}.{minor}.{patch}.{release}
8+
{major}.{minor}.{patch}
9+
10+
[bumpversion:part:release]
11+
optional_value = final
12+
first_value = final
13+
values =
14+
dev
15+
final
16+
17+
[bumpversion:file:activitysim/__init__.py]

.travis.yml

Lines changed: 77 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,103 @@ env:
55
global:
66
# GH_TOKEN ActivitySim/activitysim public_repo token
77
- secure: WZeCAmI08hBRgtVWUlerfizvSpOVlBxQDa/Z6HJiDUlIXdSAOIi7TAwnluOgs3lHbSqACegbLCU9CyIQa/ytwmmuwzltkSQN14EcnKea0bXyygd8DFdx4x8st8M3a4nh2svgp4BDM9PCu6T1XIZ1rYM46JsKzNk9X8GpWOVN498=
8-
jobs:
9-
# Add new TEST_SUITE jobs as needed via Travis build matrix expansion
10-
- TEST_SUITE=activitysim/abm/models
11-
- TEST_SUITE=activitysim/abm/test
12-
- TEST_SUITE=activitysim/cli
13-
- TEST_SUITE=activitysim/core
14-
- TEST_SUITE=activitysim/estimation/test/test_larch_estimation.py TEST_DEPENDS="larch>=5.5.3 -c conda-forge"
15-
- TEST_SUITE=activitysim/examples/example_mtc/test
16-
- TEST_SUITE=activitysim/examples/example_multiple_zone/test
17-
- TEST_SUITE=activitysim/examples/example_marin/test
18-
- TEST_SUITE=activitysim/examples/example_arc/test
19-
- TEST_SUITE=activitysim/examples/example_semcog/test
20-
- TEST_SUITE=activitysim/examples/example_psrc/test
21-
- TEST_SUITE=activitysim/examples/example_sandag/test
8+
- TEST_ENV=activitysim-test
9+
10+
jobs:
11+
include:
12+
# Add new TEST_SUITE jobs as needed via Travis build matrix expansion
13+
# define an alternative TEST_ENV to add special dependencies for particular tests
14+
# Test suites are arranged in groups; all tests in a group must pass before
15+
# the next stage group can begin.
16+
17+
- stage: Core Functionality
18+
env: TEST_SUITE=activitysim/abm/models
19+
- env: TEST_SUITE=activitysim/abm/test
20+
- env: TEST_SUITE=activitysim/cli
21+
- env: TEST_SUITE=activitysim/core
22+
23+
- stage: Examples
24+
name: "MTC Example"
25+
env: TEST_SUITE=activitysim/examples/example_mtc/test
26+
- name: "Multizone Example"
27+
env: TEST_SUITE=activitysim/examples/example_multiple_zone/test
28+
- name: "Marin Example"
29+
env: TEST_SUITE=activitysim/examples/example_marin/test
30+
- name: "ARC Example"
31+
env: TEST_SUITE=activitysim/examples/example_arc/test
32+
- name: "SEMCOG Example"
33+
env: TEST_SUITE=activitysim/examples/example_semcog/test
34+
- name: "PSRC Example"
35+
env: TEST_SUITE=activitysim/examples/example_psrc/test
36+
- name: "SANDAG Example"
37+
env: TEST_SUITE=activitysim/examples/example_sandag/test
38+
39+
- stage: Estimation Mode
40+
name: "Larch Test"
41+
env: TEST_SUITE=activitysim/estimation/test/test_larch_estimation.py TEST_ENV="activitysim-test-larch"
42+
43+
- stage: Deployment
44+
name: Documentation
45+
script:
46+
- coveralls
47+
# Build docs
48+
- mamba install sphinx numpydoc sphinx_rtd_theme
49+
- cd docs
50+
- make clean
51+
- make html
52+
- touch _build/html/.nojekyll
53+
deploy:
54+
- provider: pages
55+
local_dir: docs/_build/html
56+
skip_cleanup: true
57+
github_token: $GH_TOKEN
58+
keep_history: true
59+
on:
60+
branch: master
61+
- name: "PyPI Deployment"
62+
script: skip # do not want to rerun any tests
63+
deploy:
64+
- provider: pypi
65+
username: "__token__"
66+
password:
67+
secure: QeiYRslhBPyDRofmQQDU/7eWEt6OGCbG32HV5c+gxPV41zJY5g3zuIRD5xclyrrFcnSgbHkMSIq3bmhB6oCdA+zemK8TK5GZvCbfs+EtK6/lUbBTXGrRVim7lo2BBFB8p0MwN4HyLMkVdBVm4GVOZug3Coy2yAUTpSy0tREbGJg=
68+
skip_existing: true
69+
on:
70+
branch: [ master ]
2271

2372
python:
24-
- '3.7'
25-
- '3.8'
73+
- '3.9'
2674

2775
install:
28-
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
29-
- bash miniconda.sh -b -p $HOME/miniconda
76+
- wget -O Mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh
77+
- bash Mambaforge.sh -b -p $HOME/miniconda
3078
- source "$HOME/miniconda/etc/profile.d/conda.sh"
3179
- hash -r
3280
- conda config --set always_yes yes --set changeps1 no
33-
- conda update -q conda
34-
- conda info -a
35-
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
36-
- conda activate test-environment
37-
- conda install pytest pytest-cov coveralls pycodestyle $TEST_DEPENDS
38-
- pip install pytest-regressions
81+
- mamba update -q mamba
82+
- mamba info -a
83+
# write travis python version into selected test environment definition file
84+
- sed -e "s/\${TRAVIS_PYTHON_VERSION}/${TRAVIS_PYTHON_VERSION}/" conda-environments/${TEST_ENV}.yml > conda-env.yml
85+
# create test environment in one pass
86+
- mamba env create -n asimtest --file conda-env.yml
87+
- conda activate asimtest
3988
- pip install .
4089
- pip freeze
4190

4291
script:
92+
# This is the "default" script used for each test suite, unless overridden with a "script" in the jobs above.
4393
# build 2 and 3 zone test data twice since the Python test code on Linux sees these as different locations
4494
- python activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
4595
- python activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
46-
- python /home/travis/miniconda/envs/test-environment/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
47-
- python /home/travis/miniconda/envs/test-environment/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
96+
- python /home/travis/miniconda/envs/asimtest/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
97+
- python /home/travis/miniconda/envs/asimtest/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
4898
# pycodestyle
4999
- pycodestyle activitysim
50100
# run specific TEST_SUITE job on travis to avoid job max time
51101
- travis_wait 50 py.test $TEST_SUITE --cov activitysim --cov-report term-missing --durations=0
52-
53-
after_success:
54102
- coveralls
55-
# Build docs
56-
- pip install sphinx numpydoc sphinx_rtd_theme
57-
- cd docs
58-
- make clean
59-
- make html
60-
- touch _build/html/.nojekyll
61103

62-
deploy:
63-
provider: pages
64-
local_dir: docs/_build/html
65-
skip_cleanup: true
66-
github_token: $GH_TOKEN
67-
keep_history: true
68-
on:
69-
branch: master
104+
70105

71106
notifications:
72107
slack:

HOW_TO_RELEASE.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# How to issue an ActivitySim release
2+
3+
> **WARNING: These instructions are incomplete.**
4+
5+
01. Check that the branch you intend to release is passing tests on Travis.
6+
If it's not passing there you should not release it.
7+
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
11+
directory) and running:
12+
```sh
13+
conda create -n TEMP-ASIM-DEV python=3.9 git gh -c conda-forge --override-channels
14+
conda activate TEMP-ASIM-DEV
15+
gh auth login # <--- (only needed if gh is not logged in)
16+
gh repo clone ActivitySim/activitysim
17+
cd activitysim
18+
```
19+
20+
00. Per project policy, code on the master branch should have been released,
21+
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
23+
version on GitHub:
24+
```sh
25+
git switch develop
26+
git pull
27+
```
28+
29+
00. Update your Conda environment for testing. We do not want to use an
30+
existing environment on your machine, as it may be out-of-date
31+
and we want to make sure everything passes muster using the
32+
most up-to-date dependencies available. The following command
33+
will update the active environment (we made this to be `TEMP-ASIM-DEV`
34+
if you followed the directions above).
35+
```sh
36+
conda env update --file=conda-environments/activitysim-dev.yml
37+
```
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
41+
up with dependencies loaded from *pip* instead of *conda-forge*.
42+
43+
00. Run pycodestyle to ensure that the codebase passes all style checks.
44+
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
46+
replicate locally, but are listed here for completeness.
47+
```sh
48+
pycodestyle .
49+
```
50+
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
54+
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
61+
two hours depending on the specs of your machine.
62+
```sh
63+
python activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
64+
python activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
65+
pytest .
66+
```
67+
68+
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+
download and run.
71+
```sh
72+
mkdir tmp-asim
73+
cd activitysim/examples
74+
python create_run_all_examples.py > ../../tmp-asim/run_all_examples.bat
75+
cd ../../tmp-asim
76+
call run_all_examples.bat
77+
```
78+
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+
to scan through the results to make sure there are no errors after the
81+
fact.
82+
```sh
83+
python ../activitysim/examples/scan_examples_for_errors.py .
84+
```
85+
86+
00. Test the notebooks in `activitysim/examples/example_mtc/notebooks`.
87+
There are also demo notebooks for estimation, but their functionality
88+
is completely tested in the unit tests run previously.
89+
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 master. The following command will open a web browser for
123+
you to create the pull request.
124+
```sh
125+
gh pr create --web
126+
```
127+
After creating the PR, confirm with the ActivitySim PMC that the release
128+
is ready before actually merging it.
129+
130+
Once final approval is granted, merge the PR into master. The presence
131+
of the git tags added earlier will trigger automated build steps to
132+
prepare and deploy the release to pypi and conda-forge.
133+
134+
00. Create a "release" on GitHub.
135+
```sh
136+
gh release create v1.2.3
137+
```
138+
For a development pre-release, include the `--prerelease` argument.
139+
As the project's policy is that only formally released code is merged
140+
to the master branch, any pre-release should also be built against a
141+
non-default branch. For example, to pre-release from the `develop`
142+
branch:
143+
```sh
144+
gh release create v1.2.3.dev0 \
145+
--prerelease \
146+
--target develop \
147+
--notes "this pre-release is for a cool new feature" \
148+
--title "Development Pre-Release"
149+
```
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
153+
environment when you should have a fresh up-to-date one next time).
154+
```sh
155+
conda deactivate
156+
conda env remove -n TEMP-ASIM-DEV
157+
```

activitysim/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# See full license in LICENSE.txt.
33

44

5-
__version__ = '1.0.1'
5+
__version__ = '1.0.2'
66
__doc__ = 'Activity-Based Travel Modeling'

0 commit comments

Comments
 (0)