Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
293 additions
and
286 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Move code to src/ and tests/ out of src/ | ||
d2af34d337ad5b9a2ced39847701ef5d040495fe | ||
# Switch to ruff | ||
458e0233aeea155ed4be0cb2c42b980dc8cbbc36 |
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,3 @@ | ||
# Code of conduct | ||
|
||
This repository is governed by Mozilla's code of conduct and etiquette guidelines. For more details please see the [Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/) and [Developer Etiquette Guidelines](https://bugzilla.mozilla.org/page.cgi?id=etiquette.html). |
File renamed without changes.
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 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 |
---|---|---|
@@ -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/kinto-http | ||
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,68 +1,55 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
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, py311-master] | ||
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: py311-master | ||
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 | ||
make install-dev | ||
- name: Use kinto @ master | ||
if: matrix.toxenv == 'py39-master' | ||
run: pip install --pre -U https://github.com/Kinto/kinto/tarball/master | ||
run: make install | ||
|
||
- name: Run server | ||
run: | | ||
make run-kinto & | ||
sleep 5 # to give kinto migrate a chance to finish | ||
- name: Run kinto | ||
run: make run-kinto & sleep 5 | ||
|
||
- 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 | ||
- name: Coveralls Parallel | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
flag-name: run-${{ join(matrix.*, '-') }} | ||
parallel: true | ||
|
||
finish: | ||
needs: unit-tests | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel-finished: true | ||
carryforward: "python-version-3.8,python-version-3.9,python-version-3.10,python-version-3.11" |
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,8 +1,7 @@ | ||
.cache | ||
*.pyc | ||
kinto_http.egg-info/ | ||
*.egg-info/ | ||
.coverage | ||
.venv/ | ||
.tox | ||
.pytest_cache/ | ||
.vscode/ |
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
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,61 +1,48 @@ | ||
VIRTUALENV = virtualenv --python=python3 | ||
VENV := $(shell echo $${VIRTUAL_ENV-.venv}) | ||
PYTHON = $(VENV)/bin/python | ||
DEV_STAMP = $(VENV)/.dev_env_installed.stamp | ||
INSTALL_STAMP = $(VENV)/.install.stamp | ||
TEMPDIR := $(shell mktemp -d) | ||
|
||
.IGNORE: clean distclean maintainer-clean | ||
.PHONY: all install virtualenv tests tests-once | ||
|
||
OBJECTS = .venv .coverage | ||
|
||
.PHONY: all | ||
all: install | ||
|
||
install: $(INSTALL_STAMP) | ||
$(INSTALL_STAMP): $(PYTHON) setup.py | ||
$(INSTALL_STAMP): $(PYTHON) pyproject.toml requirements.txt | ||
$(VENV)/bin/pip install -U pip | ||
$(VENV)/bin/pip install -Ue . | ||
$(VENV)/bin/pip install -r requirements.txt | ||
$(VENV)/bin/pip install -e ".[dev]" | ||
touch $(INSTALL_STAMP) | ||
|
||
install-dev: $(INSTALL_STAMP) $(DEV_STAMP) | ||
$(DEV_STAMP): $(PYTHON) dev-requirements.txt | ||
$(VENV)/bin/pip install -Ur dev-requirements.txt | ||
touch $(DEV_STAMP) | ||
|
||
virtualenv: $(PYTHON) | ||
$(PYTHON): | ||
$(VIRTUALENV) $(VENV) | ||
python3 -m venv $(VENV) | ||
|
||
need-kinto-running: | ||
@curl http://localhost:8888/v0/ 2>/dev/null 1>&2 || (echo "Run 'make run-kinto' before starting tests." && exit 1) | ||
|
||
run-kinto: install-dev | ||
$(VENV)/bin/kinto migrate --ini kinto_http/tests/config/kinto.ini | ||
$(VENV)/bin/kinto start --ini kinto_http/tests/config/kinto.ini | ||
run-kinto: install | ||
$(VENV)/bin/kinto migrate --ini tests/config/kinto.ini | ||
$(VENV)/bin/kinto start --ini tests/config/kinto.ini | ||
|
||
tests-once: install-dev need-kinto-running | ||
.PHONY: tests | ||
test: tests | ||
tests: install need-kinto-running | ||
$(VENV)/bin/pytest --cov-report term-missing --cov-fail-under 100 --cov kinto_http | ||
|
||
functional: install-dev need-kinto-running | ||
.PHONY: functional | ||
functional: install need-kinto-running | ||
$(VENV)/bin/pytest -k "test_functional" | ||
|
||
tests: install-dev need-kinto-running lint | ||
$(VENV)/bin/pytest | ||
.PHONY: lint | ||
lint: install | ||
$(VENV)/bin/ruff check src tests | ||
$(VENV)/bin/ruff format --check src tests | ||
|
||
format: install-dev | ||
$(VENV)/bin/isort --profile=black --lines-after-imports=2 kinto_http | ||
$(VENV)/bin/black kinto_http | ||
$(VENV)/bin/flake8 kinto_http | ||
|
||
lint: install-dev | ||
$(VENV)/bin/therapist run --use-tracked-files kinto_http | ||
.PHONY: format | ||
format: install | ||
$(VENV)/bin/ruff check --fix src tests | ||
$(VENV)/bin/ruff format src tests | ||
|
||
.IGNORE: clean | ||
clean: | ||
find . -name '*.pyc' -delete | ||
find . -name '__pycache__' -type d | xargs rm -fr | ||
|
||
distclean: clean | ||
rm -fr *.egg *.egg-info/ dist/ build/ | ||
|
||
maintainer-clean: distclean | ||
rm -fr .venv/ .tox/ | ||
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 |
Oops, something went wrong.