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

Break out utils.run_shell_command to new class #526

Closed

Conversation

elebow
Copy link
Contributor

@elebow elebow commented Apr 7, 2020

Description of proposed changes

No functional changes. Rewrite utils.run_shell_command as a class.

This obsoletes #513. If this one is merged first, #513 should be closed.

Related issue(s)

none

Testing

Unit tests included.

@elebow elebow force-pushed the refactor-run_shell_command-as-class branch from 874e6bb to d105606 Compare April 7, 2020 02:03
@elebow
Copy link
Contributor Author

elebow commented Apr 7, 2020

The test builds are failing because of (I think) #527.

@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #526 into master will increase coverage by 0.66%.
The diff coverage is 91.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #526      +/-   ##
==========================================
+ Coverage   18.65%   19.31%   +0.66%     
==========================================
  Files          31       32       +1     
  Lines        5061     5079      +18     
  Branches     1282     1282              
==========================================
+ Hits          944      981      +37     
+ Misses       4090     4071      -19     
  Partials       27       27              
Impacted Files Coverage Δ
augur/util_support/shell_command_runner.py 91.48% <91.48%> (ø)
augur/utils.py 22.79% <100.00%> (-0.13%) ⬇️
augur/sequence_traits.py 8.95% <0.00%> (+0.06%) ⬆️
augur/translate.py 16.99% <0.00%> (+0.06%) ⬆️
augur/traits.py 7.96% <0.00%> (+0.06%) ⬆️
augur/ancestral.py 11.11% <0.00%> (+0.11%) ⬆️
augur/clades.py 11.34% <0.00%> (+0.11%) ⬆️

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 e03e1da...781cc06. Read the comment docs.

tests/builds/runner.sh Outdated Show resolved Hide resolved
Ongoing refactoring efforts have been trying to introduce new packages.
All packages must be listed in the packages argument to
`setuptools.setup()`.

`setuptools.find_packages()` provides a convenient way to list all
packages without manually updating a list.
@elebow elebow force-pushed the refactor-run_shell_command-as-class branch from 17ac42f to 781cc06 Compare April 9, 2020 04:08
def modified_env(self):
env = os.environ.copy()

if self.extra_env:
Copy link

Choose a reason for hiding this comment

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

Would it make sense to use a ChainMap for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jstoja This would be a clever improvement to the current code. I've opted to merge this PR as it is (or rather through the rebase at #577), just because it primarily refactors existing code without changing any other logic.

If you are up for adding the ChainMap improvement to this class, I would love to review it and add it to master.

@huddlej
Copy link
Contributor

huddlej commented Jun 26, 2020

Thanks for the refactor and tests, @elebow!

I've rebased your branch onto master, resolved the conflicts, and pushed this as a new PR #577. I'm going to close this PR and merged that PR now for a cleaner version history.

@huddlej huddlej closed this Jun 26, 2020
@elebow elebow deleted the refactor-run_shell_command-as-class branch July 4, 2020 04: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.

3 participants