Skip to content

Overhaul docs, packaging, 1.5rc #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
27c01f6
build(doc/conf): Update libvcs path
tony Aug 8, 2020
babf97f
build(docs): Remove unused releases variables
tony Aug 8, 2020
308d963
docs: Fix gh link path
tony Aug 9, 2020
9ef6182
build: Update Makefile to latest and greatest
tony Aug 10, 2020
95d8c2a
build(MANIFEST): Add pyproject.toml
tony Aug 10, 2020
c8d75c7
build(pyproject): Add classifiers
tony Aug 10, 2020
55306a2
chore: Fix makefile typo
tony Aug 10, 2020
26d16d5
build(sphinx): Add napoleon
tony Aug 10, 2020
aff2706
build(sphinx): Add sphinx-click
tony Aug 10, 2020
74b5bd5
build(sphinx): Update to latest and greatest
tony Aug 10, 2020
aee7908
build(poetry): Add sphinx-click, update packages
tony Aug 10, 2020
adf7a54
docs: Add sphinx-click CLI
tony Aug 10, 2020
3d96b3e
docs: Update CHANGES
tony Aug 10, 2020
46a99db
refactor(docs): Update doc/ to docs/
tony Aug 10, 2020
23ae2a4
docs: Remove en/latest from urls
tony Aug 10, 2020
c39cce6
docs: Remove table from README
tony Aug 10, 2020
8233663
build: Add recommonmark
tony Aug 10, 2020
36069e0
build(sphinx): Add recommonmark config
tony Aug 10, 2020
2580769
docs: Add new development page
tony Aug 10, 2020
6e5bd95
docs: Fix startline
tony Aug 10, 2020
a3e3a43
docs: Add layout file
tony Aug 10, 2020
f4c3367
docs: Add images, manifest file
tony Aug 10, 2020
51e4a08
build(sphinx): Add manifest.json to copy over
tony Aug 10, 2020
301e557
build(metadata): Tweak description of project
tony Aug 10, 2020
08b4467
build(pyproject): Add script output
tony Aug 10, 2020
a1830f9
build: Tag v1.5.0a1
tony Aug 10, 2020
adfd5a5
build(CI): rename to tests.yml
tony Aug 10, 2020
feb40df
build(publish-docs): Add config
tony Aug 10, 2020
52a8b81
fix(sphinx): Imports
tony Aug 10, 2020
d72ddc0
build(tests): Update to latest and greatest caching
tony Aug 10, 2020
5339667
build(codecov): Quiet down codecov
tony Aug 10, 2020
ad36b0d
docs: Fix test badge
tony Aug 10, 2020
ef79358
build(libvsc): Update to 0.5.0a1 (built via poetry)
tony Aug 10, 2020
7c86d88
build(vcspull): Tag v1.5.0a2
tony Aug 10, 2020
e5a97ec
build: Sync poetry.lock
tony Aug 10, 2020
5773111
docs: Fix link
tony Aug 11, 2020
5bef968
docs: Fix metadata
tony Aug 11, 2020
7bc3f3e
docs: Port to numpy-style format
tony Aug 11, 2020
58c85d4
build: gitignore pattern tweaks
tony Aug 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
codecov:
notify:
require_ci_to_pass: no

coverage:
precision: 2
round: down
range: "70...100"
status:
project:
default:
target: auto
threshold: 1%
base: auto
patch: off
97 changes: 97 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Publish Docs

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.x' ]
steps:
- uses: actions/checkout@v1
- name: Configure git
run: |
git config --global user.name 'travis-ci'
git config --global user.email '[email protected]'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Get full Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

- name: Install poetry
run: |
curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
python get-poetry.py -y
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
rm get-poetry.py

- name: Get poetry cache paths from config
run: |
echo ::set-env name=poetry_cache_dir::$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^"//' -e 's/"$//')
echo ::set-env name=poetry_virtualenvs_path::$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^"//' -e 's/"$//')

- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v2
id: cache
with:
path: |
.venv
{{ env.poetry_cache_dir }}
{{ env.poetry_virtualenvs_path }}
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv

- name: Upgrade pip
shell: bash
run: poetry run python -m pip install pip -U

- name: Install dependencies [w/ docs]
run: poetry install --extras "docs lint"

- name: Build documentation
run: |
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd

- name: Push documentation to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository

- name: Generate list of changed files for CloudFront to invalidate
run: |
pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd
for file in $FILES; do
echo $file
# add bare directory to list of updated paths when we see index.html
[[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//'
done | sort | uniq | tr '\n' ' ' > .updated_files

- name: Invalidate on CloudFront
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PATHS_FROM: .updated_files
74 changes: 74 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: tests

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '2.7', '3.x' ]
steps:
- uses: actions/checkout@v1
- name: Configure git
run: |
git config --global user.name 'travis-ci'
git config --global user.email '[email protected]'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Get full Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

- name: Install poetry
run: |
curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
python get-poetry.py -y
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
rm get-poetry.py

- name: Get poetry cache paths from config
run: |
echo ::set-env name=poetry_cache_dir::$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^"//' -e 's/"$//')
echo ::set-env name=poetry_virtualenvs_path::$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^"//' -e 's/"$//')

- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v2
id: cache
with:
path: |
.venv
{{ env.poetry_cache_dir }}
{{ env.poetry_virtualenvs_path }}
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv

- name: Upgrade pip
shell: bash
run: poetry run python -m pip install pip -U

- name: Install dependencies
run: poetry install -E "docs test coverage lint format"

- name: Lint with flake8
run: poetry run flake8

- name: Test with pytest
run: poetry run py.test --cov=./ --cov-report=xml

- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
34 changes: 0 additions & 34 deletions .github/workflows/vcspull-ci.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
.hypothesis/
.pytest_cache/

Expand All @@ -62,13 +62,14 @@ docs/_build/
# PyBuilder
target/

#Ipython Notebook
# ipython Notebook
.ipynb_checkpoints

# editors
.idea
.ropeproject
*.swp
.vim/

# docs
doc/_build/
Expand Down
2 changes: 1 addition & 1 deletion .tmuxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ windows:
layout: main-horizontal
options:
main-pane-height: 35
start_directory: doc/
start_directory: docs/
panes:
- focus: true
- pane
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog

Here you can find the recent changes to vcspull

current
-------
- #303 - Overhaul docs and packaging
- #303 - Add docs for CLI via sphinx-click

vcspull-1.4.3 (2020-08-05)
--------------------------
- Bump libvcs to 0.4.4
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.rst LICENSE CHANGES .tmuxp.yaml
include README.rst LICENSE CHANGES pyproject.toml .tmuxp.yaml
include requirements/*.txt
recursive-include doc *.rst
recursive-include docs *.rst
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
PY_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]py$$' 2> /dev/null
DOC_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]rst\$\|.*[.]md\$\|.*[.]css\$\|.*[.]py\$\|mkdocs\.yml\|CHANGES\|TODO\|.*conf\.py' 2> /dev/null
SHELL := /bin/bash


entr_warn:
Expand All @@ -10,25 +12,31 @@ entr_warn:
@echo "----------------------------------------------------------"

isort:
isort `${PY_FILES}`
poetry run isort `${PY_FILES}`

black:
black `${PY_FILES}` --skip-string-normalization
poetry run black `${PY_FILES}` --skip-string-normalization

test:
py.test $(test)
poetry run py.test $(test)

watch_test:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi

build_docs:
cd doc && $(MAKE) html
$(MAKE) -C docs html

watch_docs:
cd doc && $(MAKE) watch_docs
if command -v entr > /dev/null; then ${DOC_FILES} | entr -c $(MAKE) build_docs; else $(MAKE) build_docs entr_warn; fi

serve_docs:
$(MAKE) -C docs serve

dev_docs:
$(MAKE) -j watch_docs serve_docs

flake8:
flake8 vcspull tests
flake8 libvcs tests

watch_flake8:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) flake8; else $(MAKE) flake8 entr_warn; fi
Loading