Skip to content

Replace deprecated IntervalTree.search with .overlap #13

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

Merged
merged 8 commits into from
Jan 3, 2019

Conversation

AndrewLvov
Copy link

@AndrewLvov AndrewLvov commented Dec 21, 2018

Python3.3 usage leads to an error: Python 3.4 or later is required (see https://travis-ci.org/pyga/ebb-lint/jobs/471657391)

So I'm suggesting to drop 3.3 support.
Core devs decided to drop it after September 2017: https://www.python.org/dev/peps/pep-0398/#lifespan

What do you think ?

@@ -103,7 +103,7 @@ def byte_of_node(self, node):

def byte_intersection(tree, lower, upper):
ret = 0
for i in tree.search(lower, upper):
for i in tree.overlap(lower, upper):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interval.tree has been deprecated in favor of .envelop and .overlap

@@ -76,276 +76,277 @@ def scan_for_checkers(request):


all_sources = [
'',
pytest.param(s) for s in [
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all_sources is a mix of params and conditions like skipif, so I couldn't apply pytest.params(...) to all of them at the end


"""
"""
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of retabbing because the change is from:

all_sources = [
    '....'
]

to

all_sources = [
    pytest.param(s) for s in [
        '...',
    ]
]

def foo(one, two):
pass

foo(**{'one': 1}, two=2)
'''),
''', marks=pre_py35skip)])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of changes like

pre_py35skip(s)

to

pytest.param(s, marks=pre_py35skip)

@@ -65,7 +65,7 @@ def replacement(match):
@pytest.fixture(autouse=True)
def scan_for_checkers(request):
parser, options_hooks = get_parser()
args_marker = request.node.get_marker('flake8_args')
args_marker = request.node.get_closest_marker('flake8_args')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid a warning:

MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly. Please use node.get_closest_marker(name) or node.iter_markers(name).

@codecov-io
Copy link

codecov-io commented Dec 23, 2018

Codecov Report

Merging #13 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
- Coverage   99.76%   99.76%   -0.01%     
==========================================
  Files           8        7       -1     
  Lines         423      418       -5     
  Branches       87       87              
==========================================
- Hits          422      417       -5     
  Partials        1        1
Impacted Files Coverage Δ
ebb_lint/flake8.py 99.48% <100%> (ø) ⬆️
ebb_lint/checkers/__init__.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 706214d...3ed549f. Read the comment docs.

Andrey and others added 3 commits December 23, 2018 21:04
Some guidelines for contributors
* AndrewLvov/master:
  Drop support for Python 3.3
  Revert temporary code
  Update tests to comply with pytest4
  Update `intervaltree` version to >=3.0.0
  Replace deprecated `IntervalTree.search` with `.overlap`
@Julian
Copy link
Member

Julian commented Jan 3, 2019

Nice! Thanks Andrey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants