-
Notifications
You must be signed in to change notification settings - Fork 11
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
19 changed files
with
1,353 additions
and
228 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,31 +5,38 @@ name: Build package | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
branches: | ||
- master | ||
pull_request: | ||
branches: [ master ] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest,windows-latest] | ||
python-version: [3.6, 3.7, 3.8] | ||
python-version: [3.8] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U pip setuptools | ||
pip install wheel | ||
- name: Test package | ||
run: | | ||
python setup.py install | ||
pip show glocaltokens | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.5 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Test package building | ||
run: | | ||
poetry build |
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,35 @@ | ||
name: Linting & Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
name: Pre-commit | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.5 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Run pre-commit on all files | ||
run: | | ||
poetry run pre-commit run --all-files --show-diff-on-failure --color=always |
This file was deleted.
Oops, something went wrong.
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,18 +1,38 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.7.0 | ||
- id: check-added-large-files | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: local | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] | ||
- repo: https://github.com/psf/black | ||
rev: 19.3b0 | ||
hooks: | ||
- id: black | ||
args: | ||
- --safe | ||
- --quiet | ||
- id: black | ||
name: black | ||
entry: poetry run black | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: isort | ||
name: isort | ||
entry: poetry run isort | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
# - id: flake8 | ||
# name: flake8 | ||
# entry: poetry run flake8 | ||
# language: system | ||
# types: [python] | ||
# - id: pylint | ||
# name: pylint | ||
# entry: poetry run pylint | ||
# language: system | ||
# types: [python] | ||
- id: pytest | ||
name: pytest | ||
language: system | ||
entry: poetry run pytest | ||
pass_filenames: false | ||
always_run: true |
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,89 @@ | ||
# Contribution guidelines | ||
|
||
Contributing to this project should be as easy and transparent as possible, whether it's: | ||
|
||
- Reporting a bug | ||
- Discussing the current state of the code | ||
- Submitting a fix | ||
- Proposing new features | ||
|
||
## Github is used for everything | ||
|
||
Github is used to host code, to track issues and feature requests, as well as accept pull requests. | ||
|
||
Pull requests are the best way to propose changes to the codebase. | ||
|
||
1. Fork the repo and create your branch from `master`. | ||
2. If you've changed something, update the documentation. | ||
3. Make sure your code lints (using pre-commit). | ||
4. Test you contribution. | ||
5. Issue that pull request! | ||
|
||
## Any contributions you make will be under the MIT Software License | ||
|
||
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. | ||
|
||
## Report bugs using Github's [issues](../../issues) | ||
|
||
GitHub issues are used to track public bugs. | ||
Report a bug by [opening a new issue](../../issues/new/choose); it's that easy! | ||
|
||
## Write bug reports with detail, background, and sample code | ||
|
||
**Great Bug Reports** tend to have: | ||
|
||
- A quick summary and/or background | ||
- Steps to reproduce | ||
- Be specific! | ||
- Give sample code if you can. | ||
- What you expected would happen | ||
- What actually happens | ||
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) | ||
|
||
People _love_ thorough bug reports. I'm not even kidding. | ||
|
||
## Use a Consistent Coding Style | ||
|
||
Install [Poetry](https://python-poetry.org/docs/#installation) to setup developer environment. | ||
It uses [black](https://github.com/ambv/black) and [prettier](https://prettier.io/) | ||
to make sure the code follows the style. | ||
|
||
`pre-commit` can be used to run all check with one command (see dedicated section below). | ||
|
||
## Test your code modification | ||
|
||
You can use the `pre-commit` settings implemented in this repository to have | ||
linting tool checking your contributions (see dedicated section below). | ||
|
||
When writting unittests please follow the good practises like: | ||
|
||
- Use `faker` to fake the data. See [examples](https://faker.readthedocs.io/en/master/) | ||
- Use `mock` to patch objects/methods. See [examples](https://realpython.com/python-mock-library/) | ||
|
||
## Pre-commit | ||
|
||
With Poetry installed, run `poetry install` in the repo root. | ||
It will create virualenv with all required packages. | ||
|
||
If GRPC fails to compile on MacOS, run `export CFLAGS="-DHAVE_UNISTD_H"` first. It should be resolved in GRPC 1.36. | ||
|
||
After that you can run [pre-commit](https://pre-commit.com/) with settings included in the | ||
repostory to have code style and linting checks. | ||
|
||
Activate `pre-commit` git hook: | ||
|
||
```console | ||
$ poetry run pre-commit install | ||
``` | ||
|
||
Now the pre-commit tests will be done every time you commit. | ||
|
||
You can also run the tests on all repository files manually with the command: | ||
|
||
```console | ||
$ poetry run pre-commit run --all-files | ||
``` | ||
|
||
## License | ||
|
||
By contributing, you agree that your contributions will be licensed under its MIT License. |
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.