Skip to content

Commit a75fe22

Browse files
feat: Add project skeleton layout (#2)
* Add a project skeleton layout * Add basic CI framework * Add developer configuration files
1 parent 4b708da commit a75fe22

19 files changed

+324
-1
lines changed

.bumpversion.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[bumpversion]
2+
current_version = 0.0.1
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:setup.py]
7+
8+
[bumpversion:file:src/pyhf-validation/version.py]

.coveragerc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[run]
2+
branch = True
3+
source = src/hfval
4+
5+
[report]
6+
exclude_lines =
7+
if self.debug:
8+
pragma: no cover
9+
raise NotImplementedError
10+
if __name__ == .__main__.:
11+
ignore_errors = True
12+
omit =
13+
binder/*
14+
docker/*
15+
tests/*
16+
validation/*

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Ignore everything
2+
**
3+
4+
# Except the following
5+
!.git/**
6+
!docker/**
7+
!src/**
8+
!LICENSE
9+
!pyproject.toml
10+
!README.md
11+
!setup.cfg
12+
!setup.py

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
pull_request:
6+
# Run daily at 0:01 UTC
7+
schedule:
8+
- cron: '1 0 * * *'
9+
10+
jobs:
11+
test:
12+
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macOS-latest]
17+
python-version: [3.6, 3.7, 3.8]
18+
19+
steps:
20+
- uses: actions/checkout@master
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip setuptools wheel
28+
python -m pip install -q --no-cache-dir -e .[complete]
29+
python -m pip list
30+
- name: Lint with Pyflakes
31+
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
32+
run: |
33+
pyflakes src
34+
- name: Lint with Black
35+
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
36+
run: |
37+
black --check --diff --verbose .
38+
- name: Check MANIFEST
39+
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
40+
run: |
41+
check-manifest
42+
- name: Test with pytest
43+
run: |
44+
python -m pytest -r sx
45+
- name: Report coverage with Codecov
46+
if: github.event_name == 'push' && matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
47+
uses: codecov/codecov-action@master
48+
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
file: ./coverage.xml
51+
flags: unittests
52+
53+
docker:
54+
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/[email protected]
59+
- name: Build Docker image
60+
run: |
61+
docker build . \
62+
--file docker/Dockerfile \
63+
--tag pyhf-validation:$GITHUB_SHA \
64+
--compress
65+
docker images

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
language_version: python3.7

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
graft src
2+
3+
include LICENSE
4+
5+
global-exclude __pycache__ *.py[cod]

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
# pyhf-validation
1+
# pyhf Validation
2+
23
Validation utilities for HistFactory workspaces
4+
5+
[![GitHub Project](https://img.shields.io/badge/GitHub--blue?style=social&logo=GitHub)](https://github.com/pyhf/pyhf-validation)
6+
[![GitHub Actions Status: CI](https://github.com/pyhf/pyhf-validation/workflows/CI/CD/badge.svg)](https://github.com/pyhf/pyhf-validation/actions?query=workflow%3ACI%2FCD+branch%3Amaster)
7+
[![Code Coverage](https://codecov.io/gh/pyhf/pyhf-validation/graph/badge.svg?branch=master)](https://codecov.io/gh/pyhf/pyhf-validation?branch=master)
8+
9+
## Installation
10+
11+
To install `pyhf-validation` from GitHub (PyPI coming soon) run
12+
```bash
13+
python -m pip install --ignore-installed --upgrade "git+https://github.com/pyhf/pyhf-validation.git#egg=hfval"
14+
```
15+
16+
## Authors
17+
18+
Please check the [contribution statistics for a list of contributors](https://github.com/pyhf/pyhf-validation/graphs/contributors)

codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
threshold: 0.2%

docker/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.7-slim as base
2+
3+
FROM base as builder
4+
COPY . /code
5+
RUN cd /code && \
6+
apt-get -qq -y update && \
7+
apt-get -qq -y install \
8+
git && \
9+
apt-get -y autoclean && \
10+
apt-get -y autoremove && \
11+
rm -rf /var/lib/apt-get/lists/* && \
12+
python -m pip install --upgrade --no-cache-dir pip setuptools wheel && \
13+
python -m pip install --no-cache-dir . && \
14+
python -m pip list
15+
16+
FROM base
17+
COPY --from=builder /usr/local /usr/local
18+
ENTRYPOINT ["/usr/local/bin/pyhf-validation"]

0 commit comments

Comments
 (0)