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

[MRG] Rename library to sourmash #374

Merged
merged 9 commits into from
Mar 10, 2018
Merged

[MRG] Rename library to sourmash #374

merged 9 commits into from
Mar 10, 2018

Conversation

luizirber
Copy link
Member

@luizirber luizirber commented Nov 15, 2017

Change library name to sourmash instead of sourmash_lib

  • sourmash_lib is still available for older scripts
  • Remove the local sourmash script
  • Fix tests that expected the local sourmash script

Supersedes #164
Fixes #162

  • Is it mergeable?
  • make test Did it pass the tests?
  • make coverage Is the new code covered?
  • Did it change the command-line interface? Only additions are allowed
    without a major version increment. Changing file formats also requires a
    major version number increment.
  • Was a spellchecker run on the source code and documentation after
    changes were made?

@codecov-io
Copy link

codecov-io commented Nov 15, 2017

Codecov Report

Merging #374 into master will increase coverage by 0.49%.
The diff coverage is 98.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #374      +/-   ##
==========================================
+ Coverage   90.07%   90.56%   +0.49%     
==========================================
  Files          32       33       +1     
  Lines        4824     4854      +30     
  Branches       36       36              
==========================================
+ Hits         4345     4396      +51     
+ Misses        478      457      -21     
  Partials        1        1
Impacted Files Coverage Δ
sourmash/sbt.py 83.09% <ø> (ø)
sourmash/__main__.py 100% <ø> (ø)
sourmash/sbtmh.py 86.36% <ø> (ø)
sourmash/signature.py 94.61% <ø> (ø)
sourmash/sbt_storage.py 95.4% <ø> (ø)
sourmash/kmer_min_hash.hh 99.35% <ø> (ø)
sourmash/fig.py 88.88% <ø> (ø)
sourmash/lca/__init__.py 100% <ø> (ø)
sourmash/logging.py 100% <ø> (ø)
sourmash/lca/command_index.py 89.26% <100%> (ø)
... and 16 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 7067827...3efe726. Read the comment docs.

  * sourmash_lib is still available for older scripts
  * Remove the local sourmash script
  * Fix tests that expected the local sourmash script
@luizirber luizirber changed the title [WIP] Rename library to sourmash [MRG] Rename library to sourmash Mar 10, 2018
@luizirber luizirber requested a review from ctb March 10, 2018 02:02
@luizirber
Copy link
Member Author

Ready for review @ctb

@luizirber
Copy link
Member Author

This turned out to be easier than expected. The important lesson is avoiding doing absolute imports inside the module, so instead of doing

from sourmash import foo

do

from . import foo

instead. For external/testing code, continue doing either

from sourmash import foo

or

from sourmash_lib import foo

Copy link
Contributor

@standage standage left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@@ -51,16 +51,16 @@
"author": "C. Titus Brown",
"author_email": "[email protected]",
"license": "BSD 3-clause",
"packages": ["sourmash_lib"],
"packages": find_packages(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably recursively finds all packages and subpackages?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it is recommended by the Python packaging guide: https://packaging.python.org/tutorials/distributing-packages/#packages

# NOTE: this script is only used in 'developer' mode (python setup.py
# build_ext -i) -- see setup.py entrypoints for what end-users use.
from sourmash_lib.__main__ import main
main()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no command line entry point now? Or should we do something like pip install -e . to set up a dev environment?

Copy link
Member Author

Choose a reason for hiding this comment

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

You need pip install -e . (or python setup.py develop) to have the sourmash command available (it uses the entry point defined in setup.py).

@ctb
Copy link
Contributor

ctb commented Mar 10, 2018 via email

@ctb
Copy link
Contributor

ctb commented Mar 10, 2018 via email

Copy link
Contributor

@ctb ctb left a comment

Choose a reason for hiding this comment

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

Looks good!

@ctb ctb merged commit 12ef723 into master Mar 10, 2018
@ctb ctb deleted the refactor/rename branch March 10, 2018 14:48
@ctb
Copy link
Contributor

ctb commented Mar 10, 2018

Note: if developers get an error AttributeError: 'SourmashSignature' object has no attribute 'get', then they need to do a pip install -e . again to update the install to point at sourmash instead of sourmash_lib.

@luizirber
Copy link
Member Author

@ctb yes, it is better to 'reset' your environment after this changes (reinstall sourmash with pip install -e .). I had some really weird test errors while developing because the environment still had parts from the old install...

@ctb
Copy link
Contributor

ctb commented Mar 11, 2018 via email

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