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

Feature/add pyupgrade #49

Merged
merged 6 commits into from
Oct 31, 2022
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
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ exclude =
__pycache__,
# Tricky imports
meiga/__init__.py,
meiga/public_api.py
meiga/public_api.py,
tests/unit/test_result_match.py # only available in Python 3.10 and above

max-line-length = 110

Expand Down
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ repos:
require_serial: true
fail_fast: true

- id: pyupgrade
name: Pyupgrade
entry: pyupgrade --py37-plus
types: [ python ]
language: system
exclude: ^docs/.*$
fail_fast: true

- id: isort
name: isort
entry: isort .
entry: isort meiga tests
language: system
types: [ python ]
require_serial: true
fail_fast: true


7 changes: 4 additions & 3 deletions lume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ steps:
- find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
lint:
run:
- black --check .
- flake8 $PACKAGE_NAME
- isort .
- black --check $PACKAGE_NAME tests
- flake8 $PACKAGE_NAME tests
- pyupgrade --py37-plus `find $PACKAGE_NAME tests -name "*.py" -type f ! -name "*test_result_match.py"`
- isort $PACKAGE_NAME tests
check-requirements:
run: safety check -r requirements/requirements.txt
static-analysis:
Expand Down
2 changes: 1 addition & 1 deletion meiga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ROOT_PATH = os.path.abspath(os.path.dirname(__file__))

with open(f"{ROOT_PATH}/VERSION", "r") as f:
with open(f"{ROOT_PATH}/VERSION") as f:
__version__ = f.read().rstrip()

__all__ = public_api.__all__
5 changes: 0 additions & 5 deletions meiga/public_api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# coding=utf-8
# Copyright (C) 2021+ Alice, Vigo, Spain

"""Public API of Alice meiga package"""

from . import decorators
from .alias import (
AnyResult,
Expand Down
3 changes: 2 additions & 1 deletion requirements/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ pytest-mock==3.10.0
pytest-env==0.8.1
pytest-variables[yaml]==2.0.0
pytest-clarity==1.0.1
hypothesis==6.56.3
hypothesis==6.56.3
pyupgrade==3.2.0