Skip to content

Refactor docs, packaging #295

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 29 commits into from
Aug 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f0e004f
build(docs): Remove settings leftover from sphinx-releases
tony Aug 8, 2020
3ca54a0
build(alagitpull): Update to 0.1.0
tony Aug 10, 2020
5636756
build(pyproject): Add extras packages, organize, lock
tony Aug 10, 2020
1de5894
build(isort): Update isort config for 5.x
tony Aug 10, 2020
772569e
build(MANIFEST): Keep pyproject.toml
tony Aug 10, 2020
9ed481a
build(codecov): Ignore loud/squeaky codecov messages
tony Aug 10, 2020
4726d5c
build(docs): Update Makefile to the latest stuff
tony Aug 10, 2020
28f5f8f
build(docs): Add icons
tony Aug 10, 2020
790310b
docs(README): Remove table
tony Aug 10, 2020
790f5b2
docs: Remove references to /en/latest
tony Aug 10, 2020
c372db4
build(pyproject): Add classifiers
tony Aug 10, 2020
52b25a3
build(setup.py): Fix quotes
tony Aug 10, 2020
d2e5dae
build(pyproject): Normalize quotes
tony Aug 10, 2020
fd43041
build(pyproject): More metadata
tony Aug 10, 2020
fb43ab9
build(pyproject): Typo fix
tony Aug 10, 2020
a681b6a
refactor(docs): Move doc/ -> docs/
tony Aug 11, 2020
96a04d9
build(docs): Update config to latest and greatest
tony Aug 11, 2020
a4c8f0e
build(docs): Update SPHINXBUILD to use poetry run
tony Aug 11, 2020
93cfe7f
docs(developing): Move to markdown
tony Aug 11, 2020
d49307a
build(docs): Add layout
tony Aug 11, 2020
42af19d
build(README): Update button to publish docs
tony Aug 11, 2020
043d32f
docs(index): Fix inclusion of buttons from README, table of contents
tony Aug 11, 2020
da76fbf
build(publish-docs): Add docs github action
tony Aug 11, 2020
8853449
build(tests): Rename CI to tests
tony Aug 11, 2020
9a69819
docs(README): Update buttons
tony Aug 11, 2020
f030bd7
docs: Template fixes
tony Aug 11, 2020
e3b1eb6
build(Makefile): Update tasks
tony Aug 11, 2020
8af7905
build(gitignore): Fixes and updates
tony Aug 11, 2020
9c9f94e
build(pyproject): Update to 0.8.3 after rebase
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: libtmux CI
name: tests

on: [push, pull_request]

Expand Down
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
# Django stuff
*.log

# Sphinx documentation
Expand All @@ -62,13 +62,11 @@ docs/_build/
# PyBuilder
target/

#Ipython Notebook
# ipython Notebook
.ipynb_checkpoints

# editors
.idea
.ropeproject
*.swp

# docs
doc/_build/
.vim
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
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
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,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}`

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 libtmux 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
64 changes: 21 additions & 43 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ powerful traversal features::
>>> pane.window.session
Session($3 foo)

.. _MIT: http://opensource.org/licenses/MIT
.. _developing and testing: http://libtmux.git-pull.com/en/latest/developing.html
.. _developing and testing: http://libtmux.git-pull.com/developing.html
.. _tmuxp: https://tmuxp.git-pull.com/
.. _documentation: https://libtmux.git-pull.com/
.. _API: https://libtmux.git-pull.com/en/latest/api.html
.. _architectural details: https://libtmux.git-pull.com/en/latest/about.html
.. _API: https://libtmux.git-pull.com/api.html
.. _architectural details: https://libtmux.git-pull.com/about.html
.. _formats: http://man.openbsd.org/OpenBSD-5.9/man1/tmux.1#FORMATS
.. _target: http://man.openbsd.org/OpenBSD-5.9/man1/tmux.1#COMMANDS

Expand All @@ -176,56 +175,35 @@ See donation options at https://git-pull.com/support.html.

Project details
---------------
- tmux support: 1.8, 1.9a, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
- python support: 2.7, >= 3.3, pypy, pypy3
- Source: https://github.com/tmux-python/libtmux
- Docs: https://libtmux.git-pull.com
- API: https://libtmux.git-pull.com/api.html
- Changelog: https://libtmux.git-pull.com/history.html
- Issues: https://github.com/tmux-python/libtmux/issues
- Test Coverage: https://codecov.io/gh/tmux-python/libtmux
- pypi: https://pypi.python.org/pypi/libtmux
- Open Hub: https://www.openhub.net/p/libtmux-python
- License: `MIT`_.

============== ==========================================================
tmux support 1.8, 1.9a, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
python support 2.7, >= 3.3, pypy, pypy3
Source https://github.com/tmux-python/libtmux
Docs https://libtmux.git-pull.com
API https://libtmux.git-pull.com/en/latest/api.html
Changelog https://libtmux.git-pull.com/en/latest/history.html
Issues https://github.com/tmux-python/libtmux/issues
Test Coverage https://codecov.io/gh/tmux-python/libtmux
pypi https://pypi.python.org/pypi/libtmux
Open Hub https://www.openhub.net/p/libtmux-python
License `MIT`_.
git repo .. code-block:: bash

$ git clone https://github.com/tmux-python/libtmux.git
install stable .. code-block:: bash

$ pip install libtmux
install dev .. code-block:: bash

$ git clone https://github.com/tmux-python/libtmux.git libtmux
$ cd ./libtmux
$ virtualenv .venv
$ source .venv/bin/activate
$ pip install -e .

See the `developing and testing`_ page in the docs for
more.
tests .. code-block:: bash

$ make test
============== ==========================================================
.. _MIT: http://opensource.org/licenses/MIT

.. |pypi| image:: https://img.shields.io/pypi/v/libtmux.svg
:alt: Python Package
:target: http://badge.fury.io/py/libtmux

.. |build-status| image:: https://github.com/tmux-python/libtmux/workflows/.github/workflows/libtmux-ci.yml/badge.svg
.. |docs| image:: https://github.com/tmux-python/libtmux/workflows/Publish%20Docs/badge.svg
:alt: Docs
:target: https://github.com/tmux-python/libtmux/actions?query=workflow%3A"Publish+Docs"

.. |build-status| image:: https://github.com/tmux-python/libtmux/workflows/tests/badge.svg
:alt: Build Status
:target: https://github.com/tmux-python/libtmux/actions
:target: https://github.com/tmux-python/tmux-python/actions?query=workflow%3A"tests"

.. |coverage| image:: https://codecov.io/gh/tmux-python/libtmux/branch/master/graph/badge.svg
:alt: Code Coverage
:target: https://codecov.io/gh/tmux-python/libtmux

.. |license| image:: https://img.shields.io/github/license/tmux-python/libtmux.svg
:alt: License

.. |docs| image:: https://readthedocs.org/projects/libtmux/badge/?version=latest
:alt: Documentation Status
:scale: 100%
:target: https://readthedocs.org/projects/libtmux/
Loading