Skip to content

Commit

Permalink
Merge 014ee46 into 2da3d15
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jan 26, 2024
2 parents 2da3d15 + 014ee46 commit 7e06634
Show file tree
Hide file tree
Showing 50 changed files with 293 additions and 286 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
@@ -0,0 +1,4 @@
# Move code to src/ and tests/ out of src/
d2af34d337ad5b9a2ced39847701ef5d040495fe
# Switch to ruff
458e0233aeea155ed4be0cb2c42b980dc8cbbc36
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
@@ -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.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Expand Up @@ -8,3 +8,11 @@ updates:
groups:
all-dependencies:
update-types: ["major", "minor", "patch"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 99
groups:
all-dependencies:
update-types: ["major", "minor", "patch"]
23 changes: 23 additions & 0 deletions .github/release.yml
@@ -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:
- "*"
14 changes: 14 additions & 0 deletions .github/workflows/labels.yaml
@@ -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
34 changes: 0 additions & 34 deletions .github/workflows/lint.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
@@ -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
87 changes: 37 additions & 50 deletions .github/workflows/test.yml
@@ -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"
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,8 +1,7 @@
.cache
*.pyc
kinto_http.egg-info/
*.egg-info/
.coverage
.venv/
.tox
.pytest_cache/
.vscode/
13 changes: 0 additions & 13 deletions .therapist.yml

This file was deleted.

9 changes: 3 additions & 6 deletions CHANGELOG.rst
Expand Up @@ -4,13 +4,10 @@ CHANGELOG
This document describes changes between each past release.


11.0.2 (unreleased)
===================

**Internal Changes**
>= 11.0.2
=========

- Drop support of Python 3.7
- Update list of Python versions to run CI tests
Since version 11.0.2, we use `Github releases <https://github.com/Kinto/kinto-http.py/releases>`_ and autogenerated changelogs.


11.0.1 (2023-04-05)
Expand Down
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

65 changes: 26 additions & 39 deletions Makefile
@@ -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

0 comments on commit 7e06634

Please sign in to comment.