Skip to content

146 update python dependencies #147

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sidharth-sundar
Copy link

Closes #146

Just updated packages to be compatible with Python 3.8 and resolved MyPy/pylint complaints

@sidharth-sundar sidharth-sundar self-assigned this Jun 22, 2022
@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #147 (8708899) into master (c25e5fb) will increase coverage by 0.06%.
The diff coverage is 66.66%.

❗ Current head 8708899 differs from pull request most recent head a26c821. Consider uploading reports for the commit a26c821 to get more accurate results

@@            Coverage Diff             @@
##           master     #147      +/-   ##
==========================================
+ Coverage   86.35%   86.42%   +0.06%     
==========================================
  Files          25       25              
  Lines        2594     2607      +13     
==========================================
+ Hits         2240     2253      +13     
  Misses        354      354              
Impacted Files Coverage Δ
vistautils/_graph.py 98.18% <0.00%> (+0.03%) ⬆️
vistautils/annotated_text_utils.py 95.52% <ø> (+0.20%) ⬆️
vistautils/attrutils.py 0.00% <ø> (ø)
vistautils/logging_utils.py 81.48% <0.00%> (ø)
vistautils/preconditions.py 58.13% <0.00%> (ø)
vistautils/scripts/directory_to_key_value_store.py 96.42% <ø> (ø)
vistautils/scripts/join_key_value_stores.py 0.00% <0.00%> (ø)
vistautils/span.py 87.03% <0.00%> (+0.12%) ⬆️
vistautils/io_utils.py 91.94% <75.00%> (+0.08%) ⬆️
vistautils/range.py 94.19% <80.00%> (ø)
... and 11 more

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 c25e5fb...a26c821. Read the comment docs.

Copy link
Collaborator

@lichtefeld lichtefeld left a comment

Choose a reason for hiding this comment

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

A few small questions about changes made.

Codecoverage is not complete due to the updates on several error messages to bring them in-line with fstrings. I'm inclined to approve over adding new tests for these sections.

@@ -687,11 +687,11 @@ def range_containing(self, value: T) -> Optional[Range[T]]:
raise NotImplementedError()

@abstractmethod
def range_enclosing_range(self, value: Range[T]) -> Optional[Range[T]]:
def range_enclosing_range(self, rng: Range[T]) -> Optional[Range[T]]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was there a compelling test failure that required changing the parameter names? Otherwise given this is a published packaged I'd refrain from doing so incase anyone is passing in parameters by keyword.

Copy link
Author

Choose a reason for hiding this comment

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

There was a pylint error complaining that the child classes (e.g. _SortedDictRangeSet) had function parameters which overwrote the abstract method's names (in this case, _SortedDictRangeSet.range_enclosing_range() used rng as a parameter where the abstract class used value. In hindsight, I don't think this should require a change at all since it didn't cause an error in the Python 3.6 environment I set up for testing. I think this is something which was ignored prior but is now raised as an issue since I updated the pylint version to work with Python 3.8

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah! Well ok, this is probably something that should change but doing so is breaking compatibility so let's just ignore the error for now.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I can revert the classes to how they were before and ignore the errors.

Copy link
Author

Choose a reason for hiding this comment

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

The parameters are now back to how they were before and the corresponding child class functions are set up to ignore the specific error pylint was raising (# pylint: disable=W0237)

@@ -28,7 +28,7 @@ def main(params: Parameters):
with byte_key_value_sink_from_params(params, eval_context=locals()) as out:
for input_path in input_paths:
with KeyValueSource.zip_bytes_source(input_path) as inp:
for key in inp.keys():
for key in inp.items():
Copy link
Collaborator

Choose a reason for hiding this comment

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

This conversion seems wrong? .keys() is not replaced by .items()?

Copy link
Author

Choose a reason for hiding this comment

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

You're correct, it slipped my mind before. I realized this error earlier today and just forgot to draft a fix. pylint prefers .items() to .keys() with the newer version, so I'll change it to the following:
for key, _ in inp.items()
I'm not really sure why pylint prefers .keys() to .items() though

Copy link
Collaborator

@lichtefeld lichtefeld Jun 22, 2022

Choose a reason for hiding this comment

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

If you just want to iterate over the keys you don't need to call any method. Dictionaries iterate over their keys by default.

Actually using .keys() may be correct here. I'd need to review the KeyValueSource more closely.

Copy link
Author

Choose a reason for hiding this comment

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

That would work too, and I think that would look cleaner than the alternative.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right ok, looks like the KeyValueSource is backed in such a way that the .keys() should be the default iterator for the object.

Sidharth Sundar added 3 commits June 22, 2022 17:18
Ignores naming specifications for some testing variables, and shifts from using .keys() to .items() for dictionary key iteration.
Update setup.py, add feature breakdown for Python 3.8 compatibility, and drop unused options in .pylintrc
@sidharth-sundar sidharth-sundar force-pushed the 146-update-python-dependencies branch from 8708899 to a26c821 Compare June 22, 2022 21:23
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.

Update for Python 3.8
2 participants