Skip to content

Commit 7763e52

Browse files
committed
Modernize: switch to ruff, remove Python 2 compat
1 parent d421e1f commit 7763e52

5 files changed

Lines changed: 11 additions & 48 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest pytest-cov coveralls pylint
30+
python -m pip install ruff pytest pytest-cov coveralls
3131
pip install -r requirements.txt
3232
pip install .
33-
- name: Lint with flake8
34-
run: |
35-
# stop the build if there are Python syntax errors or undefined names
36-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3933
- name: Run default linting script
4034
run: |
4135
./lint.sh
20.5 KB
Binary file not shown.

gtfparse/__init__.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +0,0 @@
1-
# Licensed under the Apache License, Version 2.0 (the "License");
2-
# you may not use this file except in compliance with the License.
3-
# You may obtain a copy of the License at
4-
#
5-
# http://www.apache.org/licenses/LICENSE-2.0
6-
#
7-
# Unless required by applicable law or agreed to in writing, software
8-
# distributed under the License is distributed on an "AS IS" BASIS,
9-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10-
# See the License for the specific language governing permissions and
11-
# limitations under the License.
12-
13-
from .attribute_parsing import expand_attribute_strings
14-
from .create_missing_features import create_missing_features
15-
from .parsing_error import ParsingError
16-
from .read_gtf import (
17-
read_gtf,
18-
parse_gtf,
19-
parse_gtf_pandas,
20-
parse_gtf_and_expand_attributes,
21-
REQUIRED_COLUMNS,
22-
)
23-
24-
__version__ = "2.6.0"
25-
26-
__all__ = [
27-
"__version__",
28-
"expand_attribute_strings",
29-
"create_missing_features",
30-
31-
"parse_gtf_and_expand_attributes",
32-
"REQUIRED_COLUMNS",
33-
"ParsingError",
34-
"read_gtf",
35-
"parse_gtf",
36-
"parse_gtf_pandas",
37-
]

lint.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22
set -o errexit
33

4-
find . -name '*.py' \
5-
| xargs pylint \
6-
--errors-only
4+
ruff check gtfparse/ tests/
75

8-
echo 'Passes pylint check'
6+
echo 'Passes ruff check'

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ packages = ["gtfparse"]
2525
[project.urls]
2626
"Homepage" = "https://github.com/openvax/gtfparse"
2727
"Bug Tracker" = "https://github.com/openvax/gtfparse"
28+
29+
[tool.ruff.lint]
30+
select = ["E", "F"]
31+
ignore = ["F821", "E501", "F841", "E731", "E741", "E722", "E721"]
32+
33+
[tool.ruff.lint.per-file-ignores]
34+
"__init__.py" = ["F401"]
35+
"test*/*" = ["F401"]

0 commit comments

Comments
 (0)