Skip to content

feat(install): introduce explict post-installation step#102

Merged
pavelfeldman merged 1 commit intomicrosoft:masterfrom
pavelfeldman:installation
Jul 28, 2020
Merged

feat(install): introduce explict post-installation step#102
pavelfeldman merged 1 commit intomicrosoft:masterfrom
pavelfeldman:installation

Conversation

@pavelfeldman
Copy link
Copy Markdown
Member

@pavelfeldman pavelfeldman commented Jul 28, 2020

Fix for #21

- name: Build package
run: python build_package.py
- name: Install
run: python -m playwright install
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
run: python -m playwright install
run: playwright install

Since we do pip install -e . it should be available in the PATH.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The fact that we pollute env with another executable in users's path makes me sad. I'd like to emphasize that playwright is a library, not an executable and recommend its use via -m. Once we gain a handful of cli capabilities, I'll be comfortable saying playwright in my cli!

self.handler = handler

def raise_not_installed_error(message: str) -> None:
raise Exception(f"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Probably I would prefer to create a new Error class which accepts in the constructor the browser name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah might be irrelevant since it does not only accept browser names, idk.

{message}
Please complete Playwright installation via running

"python -m playwright install"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we compare Playwright Python with Pytest, they also use just the pytest command instead of python -m pytest. So for that I would use playwright install too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above, let's celebrate the discoverable execution once we have cli options.


def main():
if 'install' not in sys.argv:
print ('Run "python -m playwright install" to complete installation')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
print ('Run "python -m playwright install" to complete installation')
print ('Run "playwright install" to complete installation')

Copy link
Copy Markdown
Contributor

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

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

.

@pavelfeldman pavelfeldman force-pushed the installation branch 2 times, most recently from 5c2a690 to a3df8f0 Compare July 28, 2020 20:01
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 28, 2020

Pull Request Test Coverage Report for Build 186220460

  • 19 of 52 (36.54%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.8%) to 86.98%

Changes Missing Coverage Covered Lines Changed/Added Lines %
playwright/helper.py 1 2 50.0%
playwright/main.py 0 2 0.0%
playwright/browser_type.py 8 19 42.11%
playwright/main.py 10 29 34.48%
Totals Coverage Status
Change from base Build 186016190: -0.8%
Covered Lines: 2866
Relevant Lines: 3295

💛 - Coveralls

@pavelfeldman pavelfeldman merged commit 34475fc into microsoft:master Jul 28, 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