Skip to content

Commit

Permalink
Merge pull request #21 from tpvasconcelos/feat/docs
Browse files Browse the repository at this point in the history
Upgrade project structure
  • Loading branch information
tpvasconcelos committed Jun 20, 2022
2 parents e5ab481 + b0491a0 commit 6e7c9b0
Show file tree
Hide file tree
Showing 79 changed files with 2,766 additions and 979 deletions.
2 changes: 0 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
# docstrings and comments use max_line_length = 80
# import statements use max_line_length = 100
max_line_length=120

# 2 space indentation
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @tpvasconcelos
30 changes: 30 additions & 0 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Setup python

description: Setup python and install dependencies

inputs:
python-version:
description: "Python version"
required: false
default: "3.9"
requirements-path:
description: "Path to requirements.txt file"
required: false
default: "requirements/ci.txt"

runs:
using: composite
steps:
- uses: actions/setup-python@v3
with:
python-version: "${{ inputs.python-version }}"
cache: pip
cache-dependency-path: "${{ inputs.requirements-path }}"

- name: Ensure pip, setuptools, and wheel are up to date
shell: bash
run: python -m pip install --upgrade pip setuptools wheel

- name: Install requirements
shell: bash
run: python -m pip install -r "${{ inputs.requirements-path }}"
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ jobs:
build:
name: Check for entry in CHANGES.md
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Grep CHANGES.md for PR number
if: contains(github.event.pull_request.labels.*.name, 'skip news') != true
run: |
Expand Down
77 changes: 0 additions & 77 deletions .github/workflows/ci.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
ci-checks:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
os:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
fail-fast: true
env:
OS: "${{ matrix.os }}"
PYTHON: "${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-python
with:
python-version: "${{ matrix.python-version }}"
- name: Run CI checks with Tox
run: tox
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
- name: Upload coverage to codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
24 changes: 24 additions & 0 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish to PyPI

on:
release:
types:
- created

jobs:
build-and-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-python
with:
python-version: "3.7"
- name: Package and upload a release to test pypi
env:
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN_TEST }}"
run: tox -e build,release-test
- name: Package and upload a release prod pypi
env:
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
run: tox -e build,release-prod
39 changes: 0 additions & 39 deletions .github/workflows/publish_pypi.yaml

This file was deleted.

10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
# add custom entries here...


# PyCharm ---
# exclude everything under
.idea/*
# except for...
!.idea/ridgeplot.iml


# ============================================================================
# My custom additions missing from
# https://github.com/github/gitignore (see bellow)
# ============================================================================

# PyCharm ---
.idea/

# celery ---
**/celery*.log
**/celery*.pid
Expand Down
26 changes: 0 additions & 26 deletions .idea/ridgeplot.iml

This file was deleted.

68 changes: 39 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.3.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
args: [ '--maxkb=500' ]
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
Expand All @@ -22,45 +22,55 @@ repos:
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: name-tests-test
args: ['--django']
- id: pretty-format-json
args: ['--autofix']
args: [ '--autofix' ]
- id: trailing-whitespace
exclude: .bumpversion.cfg

- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
args: [ --no-build-isolation ]

- repo: https://github.com/asottile/pyupgrade
rev: v2.10.0
rev: v2.34.0
hooks:
- id: pyupgrade
args: [ --py36-plus, --keep-runtime-typing]
args: [ --py36-plus, --keep-runtime-typing ]
description: Automatically upgrade syntax for newer versions of the python language.

- repo: https://github.com/psf/black
rev: 20.8b1
- repo: local
hooks:

- id: pip-compile-multi-verify
name: pip-compile-multi verify
language: python
entry: pip-compile-multi verify
files: ^requirements/
pass_filenames: false
require_serial: true
types: [ file, non-executable, text ]

- id: black
name: black
entry: black
language: python
require_serial: true
types_or: [ python, pyi, jupyter ]

- repo: https://github.com/pycqa/isort
rev: 5.7.0
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
name: isort
entry: isort
args: [ '--filter-files' ]
require_serial: true
language: python
language_version: python3
types_or: [ cython, pyi, python ]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.7.0]

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.812
# hooks:
# - id: mypy
# pass_filenames: false
name: flake8
entry: flake8
language: python
types: [ python ]
require_serial: true

0 comments on commit 6e7c9b0

Please sign in to comment.