Skip to content

Commit 65b1043

Browse files
committed
feat: inital commit
0 parents  commit 65b1043

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+667
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
See the [Scikit-HEP Developer introduction][skhep-dev-intro] for a
2+
detailed description of best practices for developing Scikit-HEP packages.
3+
4+
[skhep-dev-intro]: https://scikit-hep.org/developer/intro
5+
6+
# Setting up a development environment
7+
8+
You can set up a development environment by running:
9+
10+
```bash
11+
python3 -m venv .env
12+
source ./.env/bin/activate
13+
pip install -v -e .[all]
14+
```
15+
16+
# Post setup
17+
18+
You should prepare pre-commit, which will help you by checking that commits
19+
pass required checks:
20+
21+
```bash
22+
pip install pre-commit # or brew install pre-commit on macOS
23+
pre-commit install # Will install a pre-commit hook into the git repo
24+
```
25+
26+
You can also/alternatively run `pre-commit run` (changes only) or `pre-commit
27+
run --all-files` to check even without installing the hook.
28+
29+
# Testing
30+
31+
Use PyTest to run the unit checks:
32+
33+
```bash
34+
pytest
35+
```
36+
37+
# Building docs
38+
39+
You can build the docs using:
40+
41+
42+
From inside your environmentwith the docs extra installed, run:
43+
44+
```bash
45+
sphinx-build -M html docs docs/_build
46+
```

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
ignore:
9+
# Offical actions have moving tags like v1
10+
# that are used, so they don't need updates here
11+
- dependency-name: "actions/*"

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
- main
10+
- develop
11+
release:
12+
types:
13+
- published
14+
15+
jobs:
16+
pre-commit:
17+
name: Format
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v1
21+
- uses: actions/setup-python@v2
22+
- uses: pre-commit/[email protected]
23+
with:
24+
extra_args: --hook-stage manual --all-files
25+
26+
checks:
27+
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
28+
runs-on: ${{ matrix.runs-on }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
python-version: [3.7, 3.9]
33+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
34+
35+
include:
36+
- python-version: pypy-3.7
37+
runs-on: ubuntu-latest
38+
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
43+
- uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Install package
48+
run: python -m pip install .[test]
49+
50+
- name: Test package
51+
run: python -m pytest -ra
52+
53+
54+
dist:
55+
name: Distribution build
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- uses: actions/checkout@v1
60+
61+
- name: Build sdist and wheel
62+
run: pipx run --spec build pyproject-build
63+
64+
- uses: actions/upload-artifact@v2
65+
with:
66+
path: dist
67+
68+
- uses: pypa/[email protected]
69+
if: github.event_name == 'release' && github.event.action == 'published'
70+
with:
71+
user: __token__
72+
# Remember to generate this and set it in "GitHub Secrets"
73+
password: ${{ secrets.pypi_password }}
74+
# Remove this line
75+
repository_url: https://test.pypi.org/legacy/

.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/
139+
140+
# setuptools_scm
141+
src/*/version.py

.pre-commit-config.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 20.8b1
4+
hooks:
5+
- id: black
6+
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v3.4.0
9+
hooks:
10+
- id: check-added-large-files
11+
- id: check-case-conflict
12+
- id: check-merge-conflict
13+
- id: check-symlinks
14+
- id: check-yaml
15+
- id: debug-statements
16+
- id: end-of-file-fixer
17+
- id: mixed-line-ending
18+
- id: requirements-txt-fixer
19+
- id: trailing-whitespace
20+
21+
- repo: https://github.com/PyCQA/isort
22+
rev: 5.8.0
23+
hooks:
24+
- id: isort
25+
26+
- repo: https://github.com/asottile/pyupgrade
27+
rev: v2.11.0
28+
hooks:
29+
- id: pyupgrade
30+
args: ["--py36-plus"]
31+
32+
- repo: https://github.com/asottile/setup-cfg-fmt
33+
rev: v1.17.0
34+
hooks:
35+
- id: setup-cfg-fmt
36+
37+
- repo: https://github.com/pycqa/flake8
38+
rev: 3.9.0
39+
hooks:
40+
- id: flake8
41+
exclude: docs/conf.py
42+
additional_dependencies: [flake8-bugbear, flake8-print]
43+
44+
- repo: https://github.com/pre-commit/mirrors-mypy
45+
rev: v0.812
46+
hooks:
47+
- id: mypy
48+
files: src
49+
50+
- repo: https://github.com/mgedmin/check-manifest
51+
rev: "0.45"
52+
hooks:
53+
- id: check-manifest
54+
stages: [manual]

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2021, Andrzej Novak.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the vector package developers nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
prune *
2+
graft src
3+
graft tests
4+
5+
include LICENSE README.md pyproject.toml setup.py setup.cfg
6+
recursive-include src/mplhep/fonts/ *
7+
global-exclude __pycache__ *.py[cod] .*

0 commit comments

Comments
 (0)