Skip to content

Commit 83d621b

Browse files
committed
First version
Signed-off-by: Bernát Gábor <[email protected]>
0 parents  commit 83d621b

30 files changed

+1791
-0
lines changed

.github/workflows/check.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: check
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: "0 8 * * *"
7+
8+
concurrency:
9+
group: check-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
pre_commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
- uses: pre-commit/[email protected]
19+
20+
test:
21+
name: test ${{ matrix.py }} - ${{ matrix.os }}
22+
runs-on: ${{ matrix.os }}-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
py:
27+
- "3.10.0"
28+
- "3.9"
29+
- "3.8"
30+
- "3.7"
31+
- "3.6"
32+
os:
33+
- Windows
34+
- MacOs
35+
- Ubuntu
36+
steps:
37+
- name: Setup python for test ${{ matrix.py }}
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: ${{ matrix.py }}
41+
- uses: actions/checkout@v2
42+
with:
43+
fetch-depth: 0
44+
- name: Install tox
45+
run: python -m pip install tox>=4.0.0a9
46+
- name: Setup test suite
47+
run: python -m tox -e py -vv --notest
48+
- name: Run test suite
49+
run: python -m tox -e py --skip-pkg-install
50+
env:
51+
PYTEST_ADDOPTS: "-vv --durations=20"
52+
CI_RUN: "yes"
53+
DIFF_AGAINST: HEAD
54+
- uses: codecov/codecov-action@v1
55+
with:
56+
file: ./.tox/4/coverage.py.xml
57+
flags: tests
58+
name: ${{ matrix.py }} - ${{ matrix.os }}
59+
60+
check:
61+
name: check ${{ matrix.tox_env }} - ${{ matrix.os }}
62+
runs-on: ${{ matrix.os }}-latest
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os:
67+
- Windows
68+
- Ubuntu
69+
tox_env:
70+
- type
71+
- dev
72+
- docs
73+
- pkg_meta
74+
exclude:
75+
- { os: windows, tox_env: pkg_meta }
76+
steps:
77+
- uses: actions/checkout@v2
78+
with:
79+
fetch-depth: 0
80+
- name: Setup Python 3.10.0
81+
uses: actions/setup-python@v2
82+
with:
83+
python-version: "3.10.0"
84+
- name: Install tox
85+
run: python -m pip install tox>=4.0.0a9
86+
- name: Run check for ${{ matrix.tox_env }}
87+
run: python -m tox -e ${{ matrix.tox_env }}
88+
env:
89+
UPGRADE_ADVISORY: "yes"
90+
91+
publish:
92+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
93+
needs: [ check, test, pre_commit ]
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Setup python to build package
97+
uses: actions/setup-python@v2
98+
with:
99+
python-version: "3.10.0"
100+
- name: Install build
101+
run: python -m pip install build
102+
- uses: actions/checkout@v2
103+
with:
104+
fetch-depth: 0
105+
- name: Build package
106+
run: pyproject-build -s -w . -o dist
107+
- name: Publish to PyPI
108+
uses: pypa/gh-action-pypi-publish@master
109+
with:
110+
skip_existing: true
111+
user: __token__
112+
password: ${{ secrets.pypi_password }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.py[cod]
2+
*.swp
3+
__pycache__
4+
/src/pyproject_api/_version.py
5+
build
6+
dist
7+
*.egg-info
8+
.tox
9+
/.*_cache

.pre-commit-config.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: check-ast
6+
- id: check-builtin-literals
7+
- id: check-docstring-first
8+
- id: check-merge-conflict
9+
- id: check-yaml
10+
- id: check-toml
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- repo: https://github.com/asottile/pyupgrade
15+
rev: v2.29.0
16+
hooks:
17+
- id: pyupgrade
18+
- repo: https://github.com/PyCQA/isort
19+
rev: 5.9.3
20+
hooks:
21+
- id: isort
22+
- repo: https://github.com/psf/black
23+
rev: 21.9b0
24+
hooks:
25+
- id: black
26+
args:
27+
- --safe
28+
- repo: https://github.com/asottile/setup-cfg-fmt
29+
rev: v1.18.0
30+
hooks:
31+
- id: setup-cfg-fmt
32+
args:
33+
- --min-py3-version
34+
- "3.6"
35+
- --max-py-version
36+
- "3.10"
37+
- repo: https://github.com/tox-dev/tox-ini-fmt
38+
rev: "0.5.1"
39+
hooks:
40+
- id: tox-ini-fmt
41+
args: [ "-p", "fix" ]
42+
- repo: https://github.com/asottile/blacken-docs
43+
rev: v1.11.0
44+
hooks:
45+
- id: blacken-docs
46+
additional_dependencies:
47+
- black==21.8b0
48+
- repo: https://github.com/pre-commit/pygrep-hooks
49+
rev: v1.9.0
50+
hooks:
51+
- id: rst-backticks
52+
- repo: https://github.com/PyCQA/flake8
53+
rev: 4.0.1
54+
hooks:
55+
- id: flake8
56+
additional_dependencies:
57+
- flake8-bugbear==21.9.2
58+
- flake8-comprehensions==3.7
59+
- flake8-pytest-style==1.5
60+
- flake8-spellcheck==0.24
61+
- flake8-unused-arguments==0.0.6
62+
- flake8-noqa==1.2
63+
- pep8-naming==0.12.1

.readthedocs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
build:
3+
image: latest
4+
formats:
5+
- htmlzip
6+
python:
7+
version: 3.8
8+
install:
9+
- method: pip
10+
path: .
11+
extra_requirements:
12+
- docs
13+
sphinx:
14+
builder: html
15+
configuration: docs/conf.py

CODE_OF_CONDUCT.md

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

LICENSE

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a
2+
copy of this software and associated documentation files (the
3+
"Software"), to deal in the Software without restriction, including
4+
without limitation the rights to use, copy, modify, merge, publish,
5+
distribute, sublicense, and/or sell copies of the Software, and to
6+
permit persons to whom the Software is furnished to do so, subject to
7+
the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included
10+
in all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# [`pyproject-api`](https://pyproject-api.readthedocs.io/en/latest/)
2+
3+
[![check](https://github.com/tox-dev/pyproject-api/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/pyproject-api/actions/workflows/check.yml)
4+
[![codecov](https://codecov.io/gh/tox-dev/pyproject-api/branch/rewrite/graph/badge.svg)](https://codecov.io/gh/tox-dev/pyproject-api/branch/rewrite)
5+
[![Code style:
6+
black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
7+
[![Documentation Status](https://readthedocs.org/projects/pyproject-api/badge/?version=latest)](https://pyproject-api.readthedocs.io/en/latest/?badge=latest)

codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
informational: true
6+
comment: false

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Release History
2+
===============
3+
4+
v1.0.0 - (202-10-21)
5+
--------------------
6+
- first version

docs/conf.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from datetime import datetime
2+
3+
from pyproject_api import __version__
4+
5+
project = name = "pyproject_api"
6+
company = "tox-dev"
7+
copyright = f"2021-{datetime.today().year}, {company}"
8+
version, release = __version__, __version__.split("+")[0]
9+
10+
extensions = [
11+
"sphinx.ext.autosectionlabel",
12+
"sphinx.ext.extlinks",
13+
"sphinx.ext.autodoc",
14+
"sphinx_autodoc_typehints",
15+
"sphinx.ext.viewcode",
16+
"sphinx.ext.intersphinx",
17+
]
18+
master_doc, source_suffix = "index", ".rst"
19+
20+
html_theme = "furo"
21+
html_title, html_last_updated_fmt = "pyproject-api docs", datetime.now().isoformat()
22+
pygments_style, pygments_dark_style = "sphinx", "monokai"
23+
24+
autoclass_content, autodoc_typehints = "both", "none"
25+
autodoc_default_options = {"members": True, "member-order": "bysource", "undoc-members": True, "show-inheritance": True}
26+
inheritance_alias = {}
27+
28+
extlinks = {
29+
"issue": ("https://github.com/tox-dev/pyproject-api/issues/%s", "#"),
30+
"pull": ("https://github.com/tox-dev/pyproject-api/pull/%s", "PR #"),
31+
"user": ("https://github.com/%s", "@"),
32+
}
33+
intersphinx_mapping = {
34+
"python": ("https://docs.python.org/3", None),
35+
"packaging": ("https://packaging.pypa.io/en/latest", None),
36+
}
37+
38+
nitpicky = True
39+
nitpick_ignore = []

0 commit comments

Comments
 (0)