-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add gh actions and config * reformat * Move codecov to right folder * Add dist and clean commands * add wheel to reqs * Fix wheel paths
- Loading branch information
Showing
9 changed files
with
137 additions
and
32 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
precision: 1 | ||
round: down | ||
range: "70...100" | ||
status: | ||
project: # Coverage of whole project | ||
default: | ||
target: auto # Coverage target to pass; auto is base commit | ||
threshold: 2% # Allow coverage to drop by this much vs. base and still pass | ||
patch: # Coverage of lines in this change | ||
default: | ||
target: 80% # Coverage target to pass | ||
threshold: 20% # Allow coverage to drop by this much vs. base and still pass | ||
|
||
comment: | ||
layout: "diff,flags,tree" |
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,46 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
schedule: | ||
# Run every Sunday | ||
- cron: "0 0 * * 0" | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.os }}, Python ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
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 -r requirements-dev.txt | ||
- name: Run lint and test | ||
run: | | ||
make test | ||
- name: Build distribution and test installation | ||
shell: bash | ||
run: | | ||
make dist | ||
python -m pip install dist/pandas_path-*.whl --no-deps --force-reinstall | ||
python -m pip install dist/pandas_path-*.tar.gz --no-deps --force-reinstall | ||
- name: Upload coverage to codecov | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
fail_ci_if_error: 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 |
---|---|---|
@@ -1 +1,9 @@ | ||
*.pyc | ||
*.pyc | ||
|
||
*.egg-info/ | ||
|
||
.vscode/ | ||
|
||
htmlcov/ | ||
.coverage | ||
coverage* |
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,25 +1,44 @@ | ||
reqs: | ||
requirements: | ||
pip install -r requirements-dev.txt | ||
|
||
test: lint | ||
py.test -vv pandas_path/tests.py | ||
|
||
lint: | ||
black . | ||
black --check . | ||
flake8 . | ||
|
||
clean_pycache: | ||
find . -name *.pyc -delete && find . -name __pycache__ -delete | ||
format: | ||
black . | ||
|
||
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts | ||
|
||
clean-build: ## remove build artifacts | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr .eggs/ | ||
find . -name '*.egg-info' -exec rm -fr {} + | ||
find . -name '*.egg' -exec rm -f {} + | ||
|
||
clean-pyc: ## remove Python file artifacts | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
clean: clean_pycache | ||
rm -rf dist | ||
rm -rf pandas_path.egg-info | ||
clean-test: ## remove test and coverage artifacts | ||
rm -fr .tox/ | ||
rm -f .coverage | ||
rm -fr htmlcov/ | ||
rm -fr .pytest_cache | ||
|
||
package: clean | ||
dist: clean ## builds source and wheel package | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
ls -l dist | ||
|
||
distribute_pypitest: package | ||
distribute_pypitest: dist | ||
twine upload --repository pypitest dist/*.tar.gz | ||
|
||
distribute_pypi: package | ||
distribute_pypi: dist | ||
twine upload --repository pypi dist/*.tar.gz |
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
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,10 @@ | ||
[tool.black] | ||
line-length = 99 | ||
target-version = ['py36', 'py37', 'py38'] | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
/( | ||
\.git | ||
| \.venv | ||
) | ||
''' |
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
black | ||
flake8 | ||
pytest | ||
twine | ||
pytest-cov | ||
twine | ||
wheel |
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,11 +1,20 @@ | ||
[metadata] | ||
description-file = README.md | ||
[aliases] | ||
# Define setup.py command aliases here | ||
test = pytest | ||
|
||
[flake8] | ||
ignore = E731,E266,E501,C901,W503 | ||
ignore = E731,E266,E501,C901,W503,E203 | ||
max-line-length = 99 | ||
exclude = .git | ||
exclude = | ||
.git | ||
|
||
[pep8] | ||
max-line-length = 99 | ||
exclude = .git | ||
[mypy] | ||
ignore_missing_imports = True | ||
allow_redefinition = True | ||
|
||
[tool:pytest] | ||
testpaths = pandas_path/tests.py | ||
addopts = --cov=pandas_path --cov-report=term --cov-report=html --cov-report=xml | ||
|
||
[coverage:report] | ||
include = pandas_path/**.py |