Skip to content

Commit

Permalink
chore: modernize CI/CD (#1)
Browse files Browse the repository at this point in the history
* docs: use autoclasstoc

* chore: modernize CI/CD

* chore: only test python>=3.6

* chore: only test on push (that include PRs)

* chore: fix keyword field

* chore: add a module-level docstring

* chore: remove debugging code from previous commmit
  • Loading branch information
kalekundert committed Jun 21, 2020
1 parent 64c79b1 commit f597365
Show file tree
Hide file tree
Showing 22 changed files with 678 additions and 746 deletions.
7 changes: 0 additions & 7 deletions .bumpversion.cfg

This file was deleted.

1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
2 changes: 0 additions & 2 deletions .env

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test and release

on: push

jobs:

test:
name: Test
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install '.[tests]'
- name: Run test suite
run: |
pytest tests --cov vecrec
- name: Report test coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
coveralls
release:
name: Release to PyPI
runs-on: ubuntu-latest
if: github.ref == 'master'
needs: [test]

steps:
- uses: actions/checkout@v2
with:
# Make sure the whole repository history is present, so that
# python-semantic-release can decide if a new release is needed.
fetch-depth: 0

- uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}

15 changes: 15 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# How to install the project. We need to specify to use `pip`, because
# otherwise RTD may try to directly execute `setup.py`, which doesn't exist.
python:
version: 3.6
install:
- method: pip
path: .
extra_requirements:
- docs
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .unenv

This file was deleted.

8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

11 changes: 5 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**********************************************
``vecrec`` --- 2D vector and rectangle classes
**********************************************
********************************************
``vecrec`` 2D vector and rectangle classes
********************************************

This package provides 2D vector and rectangle classes. These classes were
written to be used in games, so they have some methods that conveniently tie
Expand Down Expand Up @@ -28,9 +28,8 @@ PyPI::

Basic Usage
===========
In lieu of complete API documentation, here are a few examples showing how to
construct and use use the ``Vector`` and ``Rect`` classes provided by this
package::
Here are a few examples showing how to construct and use the `Vector` and
`Rect` classes provided by this package::

>>> from vecrec import Vector, Rect
>>> a = Vector(1, 2)
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
api
19 changes: 10 additions & 9 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
BUILDDIR = build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand All @@ -21,6 +21,15 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

clean:
rm -rf $(BUILDDIR)/*
rm -rf api

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
Expand All @@ -46,14 +55,6 @@ help:
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
Expand Down
Loading

0 comments on commit f597365

Please sign in to comment.