Skip to content

Commit 6342ed3

Browse files
authored
♻️ REFACTOR: EBP Migration (#76)
Maintenance changes made, to align the coding practices with other packages in the EBP org: - Move tests outside package - Change links in README and add contributing section - Add extras to setup.py - Add `__version__` to package and read in setup.py - Add tox.ini configuration - Add and run pre-commit configuration - Pin python to >=3.6,<4 - Pin sphinx to >=2,<4 - Add GitHub CI workflow (removed TravisCI hook) - remove built docs folder and instead build docs with RTD (and test in PRs)
1 parent 782104f commit 6342ed3

79 files changed

Lines changed: 266 additions & 14978 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: continuous-integration
5+
6+
on:
7+
push:
8+
branches: [master]
9+
tags:
10+
- 'v*'
11+
pull_request:
12+
13+
jobs:
14+
15+
pre-commit:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python 3.8
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: 3.8
25+
- uses: pre-commit/action@v2.0.0
26+
27+
tests:
28+
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: [3.6, 3.7, 3.8]
33+
sphinx: [">=2,<3", ">=3,<4"]
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v1
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: Install dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install "sphinx${{ matrix.sphinx }}"
45+
pip install .[testing]
46+
- name: Run pytest
47+
run: |
48+
pytest --cov=sphinx_tabs --cov-report=xml --cov-report=term-missing
49+
- name: Upload to Codecov
50+
if: matrix.python-version == 3.7 && matrix.sphinx == '>=3,<=4' && github.repository == 'executablebooks/sphinx-tabs'
51+
uses: codecov/codecov-action@v1
52+
with:
53+
name: sphinx-tabs-pytests-py3.7
54+
flags: pytests
55+
file: ./coverage.xml
56+
fail_ci_if_error: true
57+
58+
publish:
59+
60+
name: Publish to PyPi
61+
needs: [pre-commit, tests]
62+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout source
66+
uses: actions/checkout@v2
67+
- name: Set up Python 3.7
68+
uses: actions/setup-python@v1
69+
with:
70+
python-version: 3.7
71+
- name: Build package
72+
run: |
73+
pip install wheel
74+
python setup.py sdist bdist_wheel
75+
- name: Publish
76+
uses: pypa/gh-action-pypi-publish@v1.1.0
77+
with:
78+
user: __token__
79+
password: ${{ secrets.PYPI_KEY }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
build
2+
_build
23
dist
34
test-output
45
*.egg*
56
docs/.doctrees
7+
.tox/
8+
.vscode/
9+
__pycache__
10+
*.pyc
11+
.DS_Store

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
3+
- repo: git://github.com/pre-commit/pre-commit-hooks
4+
rev: v2.2.3
5+
hooks:
6+
- id: check-json
7+
- id: check-yaml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
11+
- repo: https://github.com/mgedmin/check-manifest
12+
rev: "0.39"
13+
hooks:
14+
- id: check-manifest
15+
16+
- repo: https://github.com/PyCQA/pylint
17+
rev: pylint-2.4.2
18+
hooks:
19+
- id: pylint
20+
args:
21+
- --disable=missing-docstring,similarities,fixme
22+
additional_dependencies:
23+
- sphinx
24+
- docutils
25+
- pygments
26+
exclude: >
27+
(?x)^(
28+
setup.py|
29+
test/.*|
30+
docs/.*
31+
)$

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
3+
python:
4+
version: 3
5+
install:
6+
- method: pip
7+
path: .
8+
9+
sphinx:
10+
builder: html
11+
fail_on_warning: true

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ v1.1.4
4040
* Fix broken javascript file inclusion
4141

4242
v1.1.3
43-
* Insert CSS and JS files after custom ones add in conf.py
43+
* Insert CSS and JS files after custom ones add in conf.py
4444

4545
v1.1.2
4646
* Add support for dirhtml builder

MANIFEST.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
exclude docs
2+
recursive-exclude docs *
3+
exclude test
4+
recursive-exclude test *
5+
exclude images
6+
recursive-exclude images *
7+
8+
exclude .pre-commit-config.yaml
9+
exclude .readthedocs.yml
10+
exclude pylint.cfg
11+
exclude tox.ini
12+
13+
include LICENSE
14+
include README.md
15+
include CHANGES.txt
16+
17+
include sphinx_tabs/tabs.js
18+
include sphinx_tabs/tabs.css
19+
recursive-include sphinx_tabs/semantic-ui-2.4.1 *

Makefile

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
sphinx-tabs [![Build Status](https://travis-ci.org/djungelorm/sphinx-tabs.svg?branch=master)](https://travis-ci.org/djungelorm/sphinx-tabs)
2-
========================================
1+
# sphinx-tabs
2+
3+
[![Github-CI][github-ci]][github-link]
4+
[![Coverage Status][codecov-badge]][codecov-link]
5+
[![PyPI][pypi-badge]][pypi-link]
36

47
Create tabbed content in [Sphinx documentation](http://www.sphinx-doc.org) when building HTML.
58

6-
For example, see the [Raw] code of [example/index.rst](example/index.rst) which generates the following:
9+
For example, see the [Raw] code of [docs/index.rst](docs/index.rst) which generates the following:
710

8-
A live demo can be found here: https://djungelorm.github.io/sphinx-tabs/
11+
A live demo can be found here: <https://sphinx-tabs.readthedocs.io>
912

1013
![Tabs](/images/tabs.gif)
1114

12-
Installation
13-
----------------------------------------
15+
## Installation
1416

1517
```bash
1618
pip install sphinx-tabs
@@ -23,14 +25,27 @@ extensions = ['sphinx_tabs.tabs']
2325
```
2426

2527
If you are using [Read The Docs](https://readthedocs.org/) for building your documentation, the extension must be added as a requirement. Please add the following to `requirements.txt` at the root of the project:
28+
29+
```
30+
sphinx-tabs==1.1.13
31+
```
32+
33+
## Contributing
34+
35+
We welcome all contributions!
36+
See the [EBP Contributing Guide](https://executablebooks.org/en/latest/contributing.html) for general details.
37+
38+
The simplest way to run tests is to install [pre-commit](https://pre-commit.com/) for linting and [tox](https://tox.readthedocs.io) for unit tests and documentation build:
39+
40+
```console
41+
$ pre-commit run --all
2642
```
27-
https://github.com/djungelorm/sphinx-tabs/releases/download/v1.1.12/sphinx-tabs-1.1.13.tar.gz
28-
```
2943

30-
An example of this can be found [here](https://github.com/djungelorm/sphinx-tabs-rtd-test/blob/master/requirements.txt).
44+
```console
45+
$ tox -p
46+
```
3147

32-
Basic Tabs
33-
----------------------------------------
48+
## Basic Tabs
3449

3550
Basic tabs can be coded as follows:
3651

@@ -52,8 +67,7 @@ Basic tabs can be coded as follows:
5267

5368
![Tabs](/images/tabs.gif)
5469

55-
Grouped Tabs
56-
----------------------------------------
70+
## Grouped Tabs
5771

5872
Tabs can be grouped, so that changing the current tab in one area changes the current tab in the
5973
another area. For example:
@@ -90,8 +104,7 @@ another area. For example:
90104

91105
![Group Tabs](/images/groupTabs.gif)
92106

93-
Code Tabs
94-
----------------------------------------
107+
## Code Tabs
95108

96109
Tabs containing code areas with syntax highlighting can be created as follows:
97110

@@ -134,3 +147,10 @@ Tabs containing code areas with syntax highlighting can be created as follows:
134147
```
135148

136149
![Code Tabs](/images/codeTabs.gif)
150+
151+
[github-ci]: https://github.com/executablebooks/sphinx-tabs/workflows/continuous-integration/badge.svg?branch=master
152+
[github-link]: https://github.com/executablebooks/sphinx-tabs
153+
[pypi-badge]: https://img.shields.io/pypi/v/sphinx-tabs.svg
154+
[pypi-link]: https://pypi.org/project/sphinx-tabs
155+
[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-tabs/branch/master/graph/badge.svg
156+
[codecov-link]: https://codecov.io/gh/executablebooks/sphinx-tabs

docs/.buildinfo

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)