Skip to content
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

chore: pass repo review #219

Merged
merged 8 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
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/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.0
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/action@v3.0.0
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/action@v3.0.0
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/codecov-action@v3.1.0
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.0

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
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
include LICENSE README.md noxfile.py
recursive-include src *.typed *.pyi
recursive-include tests *.py *.pkl
Loading