Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace flake8 and isort with ruff #1034

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

22 changes: 7 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
repos:
- repo: local
hooks:
- id: ruff
name: ruff
entry: ruff
language: system
stages: [commit]
types: [python]

- id: black
name: black
entry: black
Expand All @@ -26,13 +33,6 @@ repos:
files: \.rst$
require_serial: true

- id: flake8
name: flake8
entry: flake8
language: system
stages: [commit]
types: [python]

- id: mypy
name: mypy
entry: mypy
Expand All @@ -41,11 +41,3 @@ repos:
stages: [commit]
types: [python]
require_serial: true

- id: isort
name: isort
entry: isort
args: []
language: system
stages: [commit]
types: [python]
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Changed

- Use [ruff](https://github.com/charliermarsh/ruff) instead of **isort** and **flake8** ([#1034](https://github.com/stac-utils/pystac/pull/1034))

## [v1.7.0]

### Added
Expand Down Expand Up @@ -230,7 +234,7 @@
- Added `Collections` as a type that can be extended for extensions whose fields can appear in collection summaries ([#547](https://github.com/stac-utils/pystac/pull/547))
- Allow resolved self links when getting an object's self href ([#555](https://github.com/stac-utils/pystac/pull/555))
- Fixed type annotation on SummariesLabelExtension.label_properties setter ([#562](https://github.com/stac-utils/pystac/pull/562))
- Allow comparable types with alternate parameter naming of __lt__ method to pass structural type linting for RangeSummary ([#562](https://github.com/stac-utils/pystac/pull/562))
- Allow comparable types with alternate parameter naming of **lt** method to pass structural type linting for RangeSummary ([#562](https://github.com/stac-utils/pystac/pull/562))

## [v1.0.0-rc.3]

Expand Down Expand Up @@ -592,7 +596,7 @@ documentation for more information on the new way to use extensions.
- Dropped support for Python 3.5 [#108](https://github.com/azavea/pystac/pull/108)

- Extension classes for label, eo and single-file-stac were moved to the `pystac.extensions` package.
- the eo and label extensions changed from being a subclass of Item to wrapping items. __Note__: This is a major change in the API for dealing with extensions. See the note below for more information.
- the eo and label extensions changed from being a subclass of Item to wrapping items. **Note**: This is a major change in the API for dealing with extensions. See the note below for more information.
- Renamed the class that enumerates extension names from `Extension` to `Extensions`
- Asset properties always return a dict instead of being None for Assets that have non-core properties.
- The `Band` constructor in the EO extension changed to taking a dict. To create a band from property values,
Expand Down
3 changes: 1 addition & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ tl;dr: Run ``pre-commit install --overwrite`` to perform checks when committing,

PySTAC uses

- `ruff <https://github.com/charliermarsh/ruff>`_ for Python code linting
- `black <https://github.com/psf/black>`_ for Python code formatting
- `codespell <https://github.com/codespell-project/codespell/>`_ to check code for common misspellings
- `doc8 <https://github.com/pycqa/doc8>`__ for style checking on RST files in the docs
- `flake8 <https://flake8.pycqa.org/en/latest/>`_ for Python style checks
- `mypy <http://www.mypy-lang.org/>`_ for Python type annotation checks
- `isort <https://pycqa.github.io/isort/>` to sort Python import statements

Run all of these with ``pre-commit run --all-files`` or a single one using
``pre-commit run --all-files ID``, where ``ID`` is one of the command names above. For
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml

This file was deleted.

3 changes: 1 addition & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ black==23.1.0
codespell==2.2.4
coverage==7.2.1
doc8==1.1.1
flake8==6.0.0
html5lib==1.1
isort==5.12.0
jinja2<4.0
jsonschema==4.17.3
mypy==1.1.1
Expand All @@ -14,6 +12,7 @@ pytest-cov==4.0.0
pytest-mock==3.10.0
pytest-vcr==1.0.2
pytest==7.2.2
ruff==0.0.254
types-html5lib==1.1.11.12
types-orjson==3.6.2
types-python-dateutil==2.8.19.10
Expand Down