Skip to content

Commit

Permalink
Merge pull request #592 from ActivitySim/develop
Browse files Browse the repository at this point in the history
Infrastructure changes
  • Loading branch information
jpn-- committed Sep 12, 2022
2 parents f189143 + 7ead422 commit 8bee834
Show file tree
Hide file tree
Showing 262 changed files with 89,611 additions and 3,614 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/branch-docs.yml
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/actions-gh-pages@v3.8.0
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 }}
50 changes: 50 additions & 0 deletions .github/workflows/config-testpypi-version.py
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)
Loading

0 comments on commit 8bee834

Please sign in to comment.