-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #579 from Cornices/modernize-repo
Modernize repo
- Loading branch information
Showing
50 changed files
with
2,097 additions
and
1,922 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @Cornices/cornice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
How to contribute | ||
================= | ||
|
||
Thanks for your interest in contributing! | ||
|
||
## Reporting Bugs | ||
|
||
Report bugs at https://github.com/Cornices/cornice/issues/new | ||
|
||
If you are reporting a bug, please include: | ||
|
||
- Any details about your local setup that might be helpful in troubleshooting. | ||
- Detailed steps to reproduce the bug or even a PR with a failing tests if you can. | ||
|
||
|
||
## Ready to contribute? | ||
|
||
### Getting Started | ||
|
||
- Fork the repo on GitHub and clone locally: | ||
|
||
```bash | ||
git clone [email protected]:Cornices/cornice.git | ||
git remote add {your_name} [email protected]:{your_name}/cornice.git | ||
``` | ||
|
||
## Testing | ||
|
||
- `make test` to run all the tests | ||
|
||
## Submitting Changes | ||
|
||
```bash | ||
git checkout main | ||
git pull origin main | ||
git checkout -b issue_number-bug-title | ||
git commit # Your changes | ||
git push -u {your_name} issue_number-bug-title | ||
``` | ||
|
||
Then you can create a Pull-Request. | ||
Please create your pull-request as soon as you have at least one commit even if it has only failing tests. This will allow us to help and give guidance. | ||
|
||
You will be able to update your pull-request by pushing commits to your branch. | ||
|
||
|
||
## Releasing | ||
|
||
1. Create a release on Github on https://github.com/Cornices/cornice/releases/new | ||
2. Create a new tag `X.Y.Z` (*This tag will be created from the target when you publish this release.*) | ||
3. Generate release notes | ||
4. Publish release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 6.x.x | :white_check_mark: | | ||
| < 6.0 | :x: | | ||
|
||
## Reporting a Vulnerability | ||
|
||
If you believe you have found a Cornice-related security vulnerability, please [report it in a security advisory](https://github.com/Cornices/cornice/security/advisories/new). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- dependabot | ||
categories: | ||
- title: Breaking Changes | ||
labels: | ||
- "breaking-change" | ||
- title: Bug Fixes | ||
labels: | ||
- "bug" | ||
- title: New Features | ||
labels: | ||
- "enhancement" | ||
- title: Documentation | ||
labels: | ||
- "documentation" | ||
- title: Dependency Updates | ||
labels: | ||
- "dependencies" | ||
- title: Other Changes | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Force pull-requests label(s) | ||
|
||
on: | ||
pull_request: | ||
types: [opened, labeled, unlabeled] | ||
jobs: | ||
pr-has-label: | ||
name: Will be skipped if labelled | ||
runs-on: ubuntu-latest | ||
if: ${{ join(github.event.pull_request.labels.*.name, ', ') == '' }} | ||
steps: | ||
- run: | | ||
echo 'Pull-request must have at least one label' | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Print environment | ||
run: | | ||
python --version | ||
- name: Install pypa/build | ||
run: python3 -m pip install build | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
|
||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/cornice | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,49 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
on: pull_request | ||
|
||
name: Unit Testing | ||
jobs: | ||
chore: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
|
||
- name: Run linting and formatting checks | ||
run: make lint | ||
|
||
unit-tests: | ||
name: Unit Tests | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toxenv: [py38, py39, py310, py311, flake8] | ||
include: | ||
- toxenv: py38 | ||
python-version: "3.8" | ||
- toxenv: py39 | ||
python-version: "3.9" | ||
- toxenv: py310 | ||
python-version: "3.10" | ||
- toxenv: py311 | ||
python-version: "3.11" | ||
- toxenv: flake8 | ||
python-version: "3.11" | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install virtualenv | ||
run: | | ||
pip install virtualenv | ||
virtualenv --python=python3 .venv | ||
- name: Print environment | ||
run: | | ||
source .venv/bin/activate | ||
python --version | ||
pip --version | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
source .venv/bin/activate | ||
pip install tox | ||
run: make install | ||
|
||
- name: Tox | ||
run: | | ||
source .venv/bin/activate | ||
tox -e ${{ matrix.toxenv }} | ||
- name: Run unit tests | ||
run: make test | ||
|
||
- name: Coveralls | ||
uses: AndreMiras/coveralls-python-action@develop | ||
if: matrix.toxenv != 'flake8' | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
uses: coverallsapp/github-action@v2 | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
|
||
- name: Build docs | ||
run: make docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,44 @@ | ||
HERE = $(shell pwd) | ||
VENV = $(HERE)/.venv | ||
BIN = $(VENV)/bin | ||
PYTHON = $(BIN)/python | ||
VIRTUALENV = virtualenv | ||
|
||
.PHONY: all test docs | ||
|
||
all: build | ||
VENV := $(shell echo $${VIRTUAL_ENV-.venv}) | ||
PYTHON = $(VENV)/bin/python | ||
SPHINX_BUILD = $(shell realpath ${VENV})/bin/sphinx-build | ||
INSTALL_STAMP = $(VENV)/.install.stamp | ||
|
||
.PHONY: all | ||
all: install | ||
|
||
install: $(INSTALL_STAMP) | ||
$(INSTALL_STAMP): $(PYTHON) pyproject.toml requirements.txt | ||
$(VENV)/bin/pip install -U pip | ||
$(VENV)/bin/pip install -r requirements.txt | ||
$(VENV)/bin/pip install -r docs/requirements.txt | ||
$(VENV)/bin/pip install -e ".[dev]" | ||
touch $(INSTALL_STAMP) | ||
|
||
$(PYTHON): | ||
$(VIRTUALENV) $(VENV) | ||
python3 -m venv $(VENV) | ||
|
||
build: $(PYTHON) | ||
$(PYTHON) setup.py develop | ||
requirements.txt: requirements.in | ||
pip-compile | ||
|
||
clean: | ||
rm -rf $(VENV) | ||
.PHONY: test | ||
test: install | ||
$(VENV)/bin/pytest --cov-report term-missing --cov-fail-under 100 --cov cornice | ||
|
||
test_dependencies: build | ||
$(BIN)/pip install tox | ||
.PHONY: lint | ||
lint: install | ||
$(VENV)/bin/ruff check src tests | ||
$(VENV)/bin/ruff format --check src tests | ||
|
||
test: test_dependencies | ||
$(BIN)/tox | ||
.PHONY: format | ||
format: install | ||
$(VENV)/bin/ruff check --fix src tests | ||
$(VENV)/bin/ruff format src tests | ||
|
||
docs_dependencies: $(PYTHON) | ||
$(BIN)/pip install -r docs/requirements.txt | ||
docs: install | ||
cd docs && $(MAKE) html SPHINXBUILD=$(SPHINX_BUILD) | ||
|
||
docs: docs_dependencies | ||
cd docs && $(MAKE) html SPHINXBUILD=$(VENV)/bin/sphinx-build | ||
.IGNORE: clean | ||
clean: | ||
find src -name '__pycache__' -type d -exec rm -fr {} \; | ||
find tests -name '__pycache__' -type d -exec rm -fr {} \; | ||
rm -rf .venv .coverage *.egg-info .pytest_cache .ruff_cache build dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.