-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #592 from ActivitySim/develop
Infrastructure changes
- Loading branch information
Showing
262 changed files
with
89,611 additions
and
3,614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: ActivitySim Branch Docs | ||
# This workflow is provided as a service for forks to build branch-specific documentation. | ||
|
||
on: push | ||
|
||
jobs: | ||
docbuild: | ||
if: "contains(github.event.head_commit.message, '[makedocs]') && (github.repository_owner != 'ActivitySim') && (github.ref_name != 'develop')" | ||
# develop branch docs are built at the end of the core test workflow, regardless of repository owner or commit message flags | ||
name: ubuntu-latest py3.9 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # get all tags, lets setuptools_scm do its thing | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
environment-file: conda-environments/docbuild.yml | ||
python-version: 3.9 | ||
activate-environment: docbuild | ||
auto-activate-base: false | ||
auto-update-conda: false | ||
- name: Install activitysim | ||
run: | | ||
python -m pip install . | ||
- name: Conda checkup | ||
run: | | ||
conda info -a | ||
conda list | ||
echo REPOSITORY ${{ github.repository }} | ||
echo REF ${{ github.ref }} | ||
echo REF_NAME ${{ github.ref_name }} | ||
- name: Build the docs | ||
run: | | ||
cd docs | ||
make clean | ||
make html | ||
- name: Push to GitHub Pages | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Token is created automatically by Github Actions, no other config needed | ||
publish_dir: ./docs/_build/html | ||
destination_dir: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import argparse | ||
import copy | ||
import pathlib | ||
|
||
import tomli | ||
import tomli_w | ||
|
||
|
||
def split_path(path, sep="/"): | ||
if isinstance(path, str): | ||
return [part for part in path.split(sep) if part] | ||
else: | ||
return path | ||
|
||
|
||
def extract(mapping, path, sep="/"): | ||
parts = split_path(path, sep=sep) | ||
cur = mapping | ||
for part in parts: | ||
cur = cur[part] | ||
|
||
return cur | ||
|
||
|
||
def update(mapping, path, value, sep="/"): | ||
new = copy.deepcopy(mapping) | ||
|
||
parts = split_path(path, sep=sep) | ||
parent = extract(new, parts[:-1]) | ||
parent[parts[-1]] = value | ||
|
||
return new | ||
|
||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("path", type=pathlib.Path) | ||
args = parser.parse_args() | ||
|
||
content = args.path.read_text() | ||
decoded = tomli.loads(content) | ||
with_local_scheme = update( | ||
decoded, "tool.setuptools_scm.local_scheme", "no-local-version", sep="." | ||
) | ||
# work around a bug in setuptools / setuptools-scm | ||
with_setuptools_pin = copy.deepcopy(with_local_scheme) | ||
requires = extract(with_setuptools_pin, "build-system.requires", sep=".") | ||
requires[0] = "setuptools>=42,<60" | ||
|
||
new_content = tomli_w.dumps(with_setuptools_pin) | ||
args.path.write_text(new_content) |
Oops, something went wrong.