diff --git a/.all-contributorsrc b/.all-contributorsrc index b5a1e9d0..c888d999 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -85,6 +85,24 @@ "contributions": [ "doc" ] + }, + { + "login": "dantrim", + "name": "Daniel Antrim", + "avatar_url": "https://avatars.githubusercontent.com/u/7841565?v=4", + "profile": "http://dantrim.github.io", + "contributions": [ + "code" + ] + }, + { + "login": "nsmith-", + "name": "Nicholas Smith", + "avatar_url": "https://avatars.githubusercontent.com/u/6587412?v=4", + "profile": "https://github.com/nsmith-", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 332b9464..83d87e73 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,11 +4,36 @@ detailed description of best practices for developing Scikit-HEP packages. [skhep-dev-intro]: https://scikit-hep.org/developer/intro -# Setting up a development environment +# Contributing + +## Setting up a development environment + +### Nox + +The fastest way to start with development is to use nox. If you don't have nox, +you can use `pipx run nox` to run it without installing, or `pipx install nox`. +If you don't have pipx (pip for applications), then you can install with with +`pip install pipx` (the only case were installing an application with regular +pip is reasonable). If you use macOS, then pipx and nox are both in brew, use +`brew install pipx nox`. + +To use, run `nox`. This will lint and test using every installed version of +Python on your system, skipping ones that are not installed. You can also run +specific jobs: + +```console +$ nox -s lint # Lint only +$ nox -s tests-3.9 # Python 3.9 tests only +$ nox -s docs -- serve # Build and serve the docs +$ nox -s build # Make an SDist and wheel +``` + +Nox handles everything for you, including setting up an temporary virtual +environment for each run. ### PyPI -You can set up a development environment using PyPI. +For extended development, you can set up a development environment using PyPI. ```bash $ python3 -m venv venv @@ -29,7 +54,7 @@ $ conda activate hist (hist)$ python -m ipykernel install --name hist ``` -# Post setup +## Post setup You should prepare pre-commit, which will help you by checking that commits pass required checks: @@ -42,7 +67,7 @@ pre-commit install # Will install a pre-commit hook into the git repo You can also/alternatively run `pre-commit run` (changes only) or `pre-commit run --all-files` to check even without installing the hook. -# Testing +## Testing Use PyTest to run the unit checks: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7e6183d..a0279dfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: python-version: - - 3.6 + - 3.7 - 3.8 - 3.9 name: Check Python ${{ matrix.python-version }} @@ -40,8 +40,11 @@ jobs: - name: Test package run: python -m pytest + - name: Temporarily pin mplhep + run: echo "mplhep<=0.3.7" >> constraints.txt + - name: Install plotting requirements too - run: python -m pip install -e ".[test,plot]" + run: python -m pip install -e ".[test,plot]" -c constraints.txt - name: Test plotting too run: python -m pytest --mpl diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a66a33d..907e5f0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 21.5b2 + rev: 21.7b0 hooks: - id: black @@ -19,15 +19,15 @@ repos: - id: trailing-whitespace - repo: https://github.com/PyCQA/isort - rev: 5.8.0 + rev: 5.9.3 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v2.19.0 + rev: v2.23.3 hooks: - id: pyupgrade - args: [--py36-plus] + args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt rev: v1.17.0 @@ -36,13 +36,13 @@ repos: # Notebook formatting - repo: https://github.com/nbQA-dev/nbQA - rev: 0.10.0 + rev: 1.1.0 hooks: - id: nbqa-black additional_dependencies: [black==20.8b1] - id: nbqa-pyupgrade - additional_dependencies: [pyupgrade==2.7.4] - args: ["--py36-plus"] + additional_dependencies: [pyupgrade==2.12.0] + args: ["--py37-plus"] - repo: https://github.com/pycqa/flake8 rev: 3.9.2 @@ -52,11 +52,12 @@ repos: additional_dependencies: [flake8-bugbear] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v0.910 hooks: - id: mypy files: ^src - additional_dependencies: ["numpy>=1.20", "matplotlib>=3.3", "boost-histogram~=1.0.1"] + args: [] + additional_dependencies: ["numpy==1.21.*", "matplotlib>=3.3", "boost-histogram~=1.0.1", "uhi~=0.3.0"] - repo: https://github.com/mgedmin/check-manifest rev: "0.46" diff --git a/README.md b/README.md index f74b8188..ada56787 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ [![pre-commit.ci status][pre-commit-badge]][pre-commit-link] [![Code style: black][black-badge]][black-link] - [![PyPI version][pypi-version]][pypi-link] [![Conda-Forge][conda-badge]][conda-link] [![PyPI platforms][pypi-platforms]][pypi-link] @@ -19,7 +18,7 @@ Hist is an analyst-friendly front-end for [boost-histogram](https://github.com/scikit-hep/boost-histogram), designed for -Python 3.7+ (3.6 users get version 2.3). See [what's new](https://hist.readthedocs.io/en/latest/changelog.html). +Python 3.7+ (3.6 users get version 2.4). See [what's new](https://hist.readthedocs.io/en/latest/changelog.html). ## Installation @@ -110,7 +109,7 @@ From a git checkout, run: python -m pip install -e .[dev] ``` -See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on setting up a development environment. +See [Contributing](https://hist.readthedocs.io/en/latest/contributing.html) guidelines for information on setting up a development environment. ## Contributors @@ -130,6 +129,8 @@ We would like to acknowledge the contributors that made this project possible ([