-
Notifications
You must be signed in to change notification settings - Fork 4
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
Un-retire screenpy-quickstart
!
#52
Comments
After coming back to this months later, i think i have an idea using >>> import pkg_resources
>>> [pkg.project_name for pkg in pkg_resources.working_set]
[..., 'screenpy', 'screenpy-selenium', 'screenpy-adapter-allure', 'screenpy-pyotp', ...] For each of the Edit: i just found this warning on the setuptools documentation:
So... import importlib
import importlib.metadata
extension_names = [
d.name
for d in importlib.metadata.distributions()
if d.name.startswith("screenpy-")
]
for extension_name in extension_names:
extension = importlib.import_module(extension_name.replace("-", "_")) I'm not sure i like this solution, but i can't find a way to get the module name to use for There has to be a way to get that module name, though. |
Phew, i found something! import importlib
import importlib.metadata
extension_names = [
package
for package in importlib.metadata.packages_distributions().keys()
if package.startswith("screenpy_")
]
for extension_name in extension_names:
extension = importlib.import_module(extension_name) |
This raises an interesting question about the style of quickstart. Does it use pytest or unittest? or is it agnostic? |
It would be nifty to bring this script back! Seeing this LinkedIn article which mentions that script, i realized folks who are trying to get into this pattern probably really liked having that handy script.
We could make it pretty slick. It could check what extensions are currently installed (
screenpy_selenium
,screenpy_requests
, etc.) and try to access a private file within them that tellsscreenpy
what files to create in the quickstart script. Or each plugin could have its own quickstart script, but evenscreenpy-selenium-quickstart
is getting kinda wordy...Also make sure to be more explicit about how the file names and structure is arbitrary and can be changed to suit the user's needs whenever they want. This is more for beginners than users making their third or fourth suite.
The text was updated successfully, but these errors were encountered: