Skip to content

Remove use of Bio._py3k in BioSql/ - #2440

Merged
peterjc merged 1 commit into
biopython:masterfrom
Dsujan:rm_py3k_imports
Dec 27, 2019
Merged

peterjc merged 1 commit into
biopython:masterfrom
Dsujan:rm_py3k_imports

Conversation

@Dsujan

@Dsujan Dsujan commented Dec 26, 2019

Copy link
Copy Markdown
Contributor

This pull request addresses issue #2420

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run flake8 locally, and
    understand that AppVeyor and TravisCI will be used to confirm the Biopython unit
    tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

@codecov

codecov Bot commented Dec 26, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #2440 into master will increase coverage by 0.12%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2440      +/-   ##
==========================================
+ Coverage   84.64%   84.76%   +0.12%     
==========================================
  Files         323      323              
  Lines       52644    52976     +332     
==========================================
+ Hits        44558    44904     +346     
+ Misses       8086     8072      -14
Impacted Files Coverage Δ
BioSQL/Loader.py 78.45% <0%> (-0.1%) ⬇️
BioSQL/BioSeqDatabase.py 72.72% <100%> (+0.2%) ⬆️
Bio/_py3k/__init__.py 40% <0%> (-3.53%) ⬇️
Bio/Align/__init__.py 88.64% <0%> (+4.52%) ⬆️
Bio/Entrez/Parser.py 87.61% <0%> (+5.53%) ⬆️

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 5f4c799...edac94f. Read the comment docs.

Comment thread BioSQL/BioSeqDatabase.py
# read the file with all comment lines removed
sql = ""
with open(sql_file, _universal_read_mode) as sql_handle:
with open(sql_file) as sql_handle:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good - that's exactly what I would have picked here.

@peterjc peterjc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good - a minor tweak to the new message, and I'd be happy to merge this.

Comment thread BioSQL/BioSeqDatabase.py Outdated
mysql-connector-python in release 2.0.0 of the package.
"""

def bytearray_to_str(self, s):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would suggest making this a private method (change the name to have a leading underscore).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, since you do not need self (it was originally a function), this can be a static method:
https://docs.python.org/3/library/functions.html#staticmethod

Basically add the @staticmethod decorator before the def line, and remove the unused self argument.

@peterjc

peterjc commented Dec 26, 2019

Copy link
Copy Markdown
Member

If you are not comfortable dealing with the merge conflict, don't worry about it - I can do that.

@Dsujan

Dsujan commented Dec 27, 2019 via email

Copy link
Copy Markdown
Contributor Author

Moved bytearray_to_str into MysqlConnectorAdaptor

Peter: Made the new method into a staticmethod with a
leading underscore (private) as part of rebasing this.
@peterjc

peterjc commented Dec 27, 2019 •

Copy link
Copy Markdown
Member

I hope your computer is working again soon - for now I have rebased this and added the static method change.

@peterjc
peterjc merged commit ee5e422 into biopython:master Dec 27, 2019
@Dsujan
Dsujan deleted the rm_py3k_imports branch January 1, 2020 05:00
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.

2 participants