-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Modernize repository * Move code to src/ and tests/ out of src/ * Run 'make format' * Add blame ignore file * Force labels on pull-requests * Try switching to parallel jobs for coveralls * Revert "Try switching to parallel jobs for coveralls" because too noisy in status report This reverts commit 014ee46. * Remove useless omit now that tests are outside * Polish contributing docs * Fix RST link
- Loading branch information
Showing
50 changed files
with
284 additions
and
326 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). |
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,7 +1,7 @@ | ||
How to contribute | ||
================= | ||
|
||
Thanks for your interest in contributing to Kinto! | ||
Thanks for your interest in contributing to the Kinto client! | ||
|
||
## Reporting Bugs | ||
|
||
|
@@ -15,43 +15,29 @@ If you are reporting a bug, please include: | |
|
||
## Ready to contribute? | ||
|
||
### System Requirements | ||
|
||
Depending on the platform and chosen configuration, some libraries or extra services are required. | ||
|
||
The following commands will install necessary tools for cryptography and Python packaging like Virtualenv. | ||
### Getting Started | ||
|
||
#### Linux | ||
On Debian / Ubuntu based systems: | ||
- Fork the repo on GitHub and clone locally: | ||
|
||
```bash | ||
apt-get install libffi-dev libssl-dev python-dev python-virtualenv | ||
git clone [email protected]:Kinto/kinto-http.py.git | ||
git remote add {your_name} [email protected]:{your_name}/kinto-http.py.git | ||
``` | ||
|
||
#### OS X | ||
Assuming [brew](http://brew.sh/) is installed: | ||
Optionally, configure `git` to use `.git-blame-ignore-revs` to remove noisy commits from `git blame` (e.g. running formatters or moving files): | ||
|
||
```bash | ||
brew install libffi openssl pkg-config python | ||
:: | ||
|
||
pip install virtualenv | ||
``` | ||
|
||
### Getting Started | ||
git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
|
||
- Fork the repo on GitHub and clone locally: | ||
|
||
```bash | ||
git clone [email protected]:Kinto/kinto-http.py.git | ||
git remote add {your_name} [email protected]:{your_name}/kinto-http.py.git | ||
``` | ||
|
||
## Testing | ||
|
||
- `make tests-once` to run the tests with the current venv. | ||
- `make tests` to run all the tests (with python3, flake8, and functional tests) | ||
- Run `make run-kinto` in a separate terminal | ||
|
||
- `make tests` to run all the tests | ||
|
||
You may need to use `make run-kinto` before running the functional tests. | ||
If you want to run the functional tests only, you can use `make functional`. | ||
|
||
## Submitting Changes | ||
|
@@ -68,3 +54,11 @@ 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/Kinto/kinto-http.py/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
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,41 @@ | ||
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 | ||
run: make install | ||
|
||
- name: Use kinto @ master | ||
if: matrix.toxenv == 'py39-master' | ||
run: pip install --pre -U https://github.com/Kinto/kinto/tarball/master | ||
- name: Run kinto | ||
run: make run-kinto & sleep 5 | ||
|
||
- name: Run server | ||
run: | | ||
make run-kinto & | ||
sleep 5 # to give kinto migrate a chance to finish | ||
- 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 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
uses: coverallsapp/github-action@v2 |
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.
Oops, something went wrong.