Skip to content

Commit

Permalink
chore: pass repo review (#219)
Browse files Browse the repository at this point in the history
* chore: pass repo review

* chore: add `noxfile`

* chore: fix pre-commit check

* Add `noxfile` to `MANIFEST.in`

* Ignore `DeprecationWarning`s

* Update setup.cfg

Co-authored-by: Henry Schreiner <[email protected]>

* chore: cleanup the changes made by pre-commit

* chore: add license badge and update MANIFEST.in

Co-authored-by: Henry Schreiner <[email protected]>
  • Loading branch information
Saransh-cpp and henryiii committed Jul 4, 2022
1 parent dfeead2 commit 02d4655
Show file tree
Hide file tree
Showing 18 changed files with 672 additions and 683 deletions.
4 changes: 1 addition & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

## Development install

You should *always* use a virtual environment when developing software. Setup:
You should _always_ use a virtual environment when developing software. Setup:

```bash
python3 -m venv .env
Expand All @@ -21,7 +20,6 @@ python -m ipykernel install --user --name vector # For notebooks

You can update the environment with `conda env update`.


## Docs

The documentation is in `/docs`. To rebuild the API docs:
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@ on:
workflow_dispatch:
release:
types:
- published
- published

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build SDist and wheel
run: pipx run build
- name: Build SDist and wheel
run: pipx run build

- uses: actions/upload-artifact@v3
with:
path: dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*

- name: Check metadata
run: pipx run twine check dist/*
- name: Check metadata
run: pipx run twine check dist/*

publish:
needs: [dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
82 changes: 41 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
push:
branches:
- main
- develop
- main
- develop
workflow_dispatch:

concurrency:
Expand All @@ -19,71 +19,71 @@ jobs:
runs-on: ubuntu-latest
name: Check SDist
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual check-manifest
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual check-manifest

checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.6
- 3.7
- 3.8
- 3.9
name: Check Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Requirements check
run: python -m pip list
- name: Requirements check
run: python -m pip list

- name: Install package
run: python -m pip install -e .[test]
- name: Install package
run: python -m pip install -e .[test]

- name: Test light package
run: python -m pytest -ra
- name: Test light package
run: python -m pytest -ra

- name: Install develop extras
run: python -m pip install -e .[dev]
- name: Install develop extras
run: python -m pip install -e .[dev]

- name: Test package
run: python -m pytest -ra --cov=vector tests/
- name: Test package
run: python -m pytest -ra --cov=vector tests/

- name: Run doctests
run: xdoctest ./src/vector/
- name: Run doctests
run: xdoctest ./src/vector/

- name: Upload coverage report
uses: codecov/[email protected]
- name: Upload coverage report
uses: codecov/[email protected]

discheck:
runs-on: ubuntu-latest
name: Disassemble check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.8.8
- uses: actions/setup-python@v4
with:
python-version: 3.8.8

- name: Requirements check
run: python -m pip list
- name: Requirements check
run: python -m pip list

- name: Check compute features
run: python -m pip install .[test,test_extras]
- name: Check compute features
run: python -m pip install .[test,test_extras]

- name: Test package
run: python -m pytest -ra -m dis
- name: Test package
run: python -m pytest -ra -m dis

# root:
# runs-on: ubuntu-latest
Expand Down
160 changes: 89 additions & 71 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,81 +1,99 @@
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: ^docs
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: ^docs
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
stages: [manual]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
hooks:
- id: mypy
files: src
args: [--show-error-codes]
additional_dependencies:
- numpy==1.22.0
- packaging

- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
stages: [manual]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-docstrings
- flake8-print

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
hooks:
- id: mypy
files: src
args: [--show-error-codes]
additional_dependencies:
- numpy==1.22.0
- packaging
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: ["-L", "hist,nd,circularly,ba"]
exclude: ^(notebooks/xarray.ipynb|notebooks/BoostHistogramHandsOn.ipynb)$

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-docstrings
- flake8-print
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
exclude: assets/js/webapp\.js

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: ["-L", "hist,nd,circularly,ba"]
exclude: ^(notebooks/xarray.ipynb|notebooks/BoostHistogramHandsOn.ipynb)$
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
args: ["-E"]
additional_dependencies: [black==22.3.0]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
exclude: ^src/vector/backends/_numba_object.py$
- id: python-no-log-warn
- id: python-no-eval
- id: python-use-type-annotations
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
exclude: ^src/vector/backends/_numba_object.py$
- id: python-no-log-warn
- id: python-no-eval
- id: python-use-type-annotations
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ formats: all
python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include LICENSE README.md
include LICENSE README.md pyproject.toml setup.py setup.cfg
recursive-include src *.typed *.pyi
recursive-include tests *.py *.pkl
Loading

0 comments on commit 02d4655

Please sign in to comment.