Skip to content

Refactor docs, CI #623

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 31 commits into from
Aug 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
218364a
chore(docs): Remove unused releases config
tony Aug 8, 2020
efc440b
build(alagitpull): Update to 0.1.0
tony Aug 10, 2020
0cb93ef
poetry(build): Sync more packages with requirements files
tony Aug 10, 2020
a28d0e1
build(Makefile): Update to latest and greatest
tony Aug 10, 2020
80b6903
build(MANIFEST): Include pyproject.toml
tony Aug 10, 2020
49307b1
build(codecov): Ignore loud codecov messages
tony Aug 10, 2020
5405218
build(docs): run through poetry by default
tony Aug 10, 2020
e19d809
build(docs): Update Makefile to latest and greatest
tony Aug 10, 2020
b556376
build(docs): Add manifest and icons
tony Aug 10, 2020
3dab36f
build(setup.py): Fix quotes
tony Aug 10, 2020
578e277
build(pyproject): Add classifiers
tony Aug 10, 2020
828308e
build(pyproject): Add more metadata
tony Aug 10, 2020
a32d8ae
build(pyproject): Add scripts for tmuxp
tony Aug 10, 2020
e2865f9
refactor(docs): Move doc/ -> docs/
tony Aug 11, 2020
0e403ac
build(conf): Update to latest and greatest
tony Aug 11, 2020
4c50f75
build(docs): Add layout
tony Aug 11, 2020
e003668
build(publish-docs): Add doc builder gh action
tony Aug 11, 2020
498093a
docs: Include buttons on docs page
tony Aug 11, 2020
ccea1ba
docs(README): Link to docs CI task
tony Aug 11, 2020
c92cc34
build(doc index): Update includes, headers
tony Aug 11, 2020
304f910
build(README): Remove table
tony Aug 11, 2020
91ad602
docs: Update /en/latest reference to new path /
tony Aug 11, 2020
798f992
build(docs): Use new libtmux site
tony Aug 11, 2020
877fd7e
docs(CHANGES): Update for this PRs changes
tony Aug 11, 2020
e1acb04
docs: Update tmuxp doc links to mention tmuxp.git-pull.com
tony Aug 11, 2020
94f799e
docs: Fix metadata
tony Aug 11, 2020
0d4654e
build: Fix .gitignore
tony Aug 11, 2020
e5ec2d8
build: Update poetry lockfile
tony Aug 16, 2020
b73ca90
ci: Remove travis
tony Aug 16, 2020
54e20a3
build: Add gh action for testing (ported via libtmux)
tony Aug 16, 2020
06454a3
docs(CHANGES): Update
tony Aug 16, 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
100 changes: 100 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: tests

on: [push, pull_request]

jobs:
build:
# Don't run twice for internal PRs from our own repo
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '2.7', '3.x' ]
tmux-version: [ '2.6', '2.7', '2.8', '3.0', 'master' ]
steps:
- uses: actions/checkout@v1

- 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 poetry 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: Setup tmux build cache for tmux ${{ matrix.tmux-version }}
id: tmux-build-cache
uses: actions/cache@v1
with:
path: ~/tmux-builds/tmux-${{ matrix.tmux-version }}
key: tmux-${{ matrix.tmux-version }}

- name: Build tmux ${{ matrix.tmux-version }}
if: steps.tmux-build-cache.outputs.cache-hit != 'true'
run: |
sudo apt install libevent-dev libncurses5-dev libtinfo-dev libutempter-dev bison
mkdir ~/tmux-builds
mkdir ~/tmux-src
git clone https://github.com/tmux/tmux.git ~/tmux-src/tmux-${{ matrix.tmux-version }}
cd ~/tmux-src/tmux-${{ matrix.tmux-version }}
git checkout ${{ matrix.tmux-version }}
sh autogen.sh
./configure --prefix=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }} && make && make install
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
cd ~
tmux -V

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

- name: Install python dependencies
run: |
poetry install -E "test coverage lint"
- name: Lint with flake8
run: |
poetry run flake8
- name: Test with pytest
continue-on-error: ${{ matrix.tmux-version == 'master' }}
run: |
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin
tmux -V
poetry run py.test --cov=./ --cov-report=xml
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .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 Down
4 changes: 2 additions & 2 deletions .tmuxp.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"options": {
"main-pane-height": 35
},
"start_directory": "doc/",
"start_directory": "docs/",
"panes": [
{
"focus": true
Expand All @@ -38,4 +38,4 @@
]
}
]
}
}
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
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Changelog

Here you can find the recent changes to tmuxp

current
-------
- :issue:`623` Move docs from RTD to self-serve site
- :issue:`623` Modernize Makefiles
- :issue:`623` New development docs
- :issue:`623` Move doc -> docs
- :issue:`623` Move tests to GitHub Actions
- :issue:`623` Update pyproject.toml to experiment with poetry packaging
- :issue:`619` isort 5

tmuxp 1.5.5 (2020-07-26)
------------------------
- :issue:`616` (via: :issue:`599`) New command: ``tmuxp ls``
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
recursive-include tests *.py *.yaml *.json *.sh
recursive-include examples *.yaml *.json
16 changes: 12 additions & 4 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:
@echo "----------------------------------------------------------"
Expand All @@ -12,7 +14,7 @@ isort:
poetry run isort `${PY_FILES}`

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

test:
poetry run py.test $(test)
Expand All @@ -21,13 +23,19 @@ 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:
poetry run flake8 tmuxp tests
poetry run flake8

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