Skip to content

Commit

Permalink
black: Move config to pyproject.toml and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Sep 9, 2020
1 parent 26636b4 commit bfa719f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.2.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: v2.1.0
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
rev: 5.5.1
hooks:
- id: isort
args: [setup.py, rioxarray/, test/, docs/]
- repo: https://github.com/asottile/blacken-docs
rev: v1.6.0
rev: v1.8.0
hooks:
- id: blacken-docs
args: [--skip-errors]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
rev: 3.8.3
hooks:
- id: flake8
args: [--max-line-length, '88', --ignore, "E225,W503,C408"]
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ This Code of Conduct is adapted from the Contributor Covenant_, version 1.4, ava

.. _Contributor Covenant: http://contributor-covenant.org
.. _version: http://contributor-covenant.org/version/1/4/

2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Ready to contribute? Here's how to set up `geocube` for local development.

$ flake8 --ignore=E731,W503,W504 --exclude --max-complexity 10 --max-line-length 88 geocube/
$ flake8 --max-line-length 88 tests/unit/ tests/functional/ tests/integration
$ black --target-version py36 --check .
$ black --check .
$ py.test

7. Commit your changes and push your branch to GitLab::
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ clean-test: ## remove test and coverage artifacts

lint: ## check style with flake8
flake8 geocube test --max-line-length 88
black --target-version py36 --check .
black --check .

check:
###### FLAKE8 #####
# No unused imports, no undefined vars,
flake8 --ignore=E731,W503,W504 --exclude --max-complexity 10 --max-line-length 88 geocube/
flake8 --max-line-length 88 tests/unit/ tests/functional/ tests/integration
black --target-version py36 --check .
black --check .

pylint:
###### PYLINT ######
Expand All @@ -85,5 +85,4 @@ install: clean ## install the package to the active Python's site-packages
python setup.py install

install-dev: clean ## install development version to active Python's site-packages
pip install -U -r requirements.txt -r requirements_dev.txt
pip install -e .[all]
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- python=3.7
- datacube
- geopandas
- rasterio
Expand Down
4 changes: 2 additions & 2 deletions geocube/_show_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def _get_gdal_info():
proj_info: dict
system GDAL information
"""
import rasterio
import fiona
import rasterio

blob = [
("fiona", fiona.__version__),
Expand Down Expand Up @@ -105,7 +105,7 @@ def show_versions():
import geocube

print(f"geocube v{geocube.__version__}\n")
print(f"GDAL deps:")
print("GDAL deps:")
_print_info_dict(_get_gdal_info())
print("\nPython deps:")
_print_info_dict(_get_deps_info())
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel"]

[tool.black]
target_version = ['py36']
2 changes: 1 addition & 1 deletion test/unit/cli/commands/test_make_geocube.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _get_called_dict(**kwargs):
_get_called_dict(measurements=("measure1", "measure2")),
),
(["-c", "epsg:4326"], _get_called_dict(output_crs="epsg:4326")),
(["--output-crs", "epsg:4326"], _get_called_dict(output_crs="epsg:4326"),),
(["--output-crs", "epsg:4326"], _get_called_dict(output_crs="epsg:4326")),
(["-r", "-10", "10"], _get_called_dict(resolution=(-10, 10))),
(["--resolution", "-10", "10"], _get_called_dict(resolution=(-10, 10))),
(["-a", "-10", "10"], _get_called_dict(align=(-10, 10))),
Expand Down

0 comments on commit bfa719f

Please sign in to comment.