Skip to content

feat: add skip_if_exists command to skip when paths exists #54

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 1 commit into from
Nov 9, 2020

Conversation

maartenbreddels
Copy link
Contributor

Upstreaming from bqplot/bqplot#1235 to make source package skip the npm build step. Note, I cannot test this, because I don't know how. Since running pip install will fetch jupyter_packaging from pypi, how can I use my local dev install? cc @martinRenou

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@blink1073 blink1073 merged commit f1871c9 into jupyter:master Nov 9, 2020
@blink1073
Copy link
Contributor

Released as 0.7.6.

return any(not Path(path).exist() for path in paths)
class SkipIfExistCommand(Command):
def initialize_options(self):
if not should_skip:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be?

if not should_skip():

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, and all(Path(path).exist() for path in paths) should improve readability

Copy link
Member

@jtpio jtpio Dec 18, 2020

Choose a reason for hiding this comment

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

Also wondering about the logic here.

Shouldn't the command be run (= not skipped) in case any of the files is missing?

Wondering whether this could be:

    def should_run():
        return any(not Path(path).exist() for path in paths)

And then:

if should_run():
    self.command = CommandClass(self.distribution)
    self.command.initialize_options()
else:
    self.command = None

Copy link
Member

Choose a reason for hiding this comment

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

OK I can submit a follow-up PR then.

@jtpio jtpio mentioned this pull request Dec 18, 2020
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