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

fix: use optional-dependencies as preferred variant to custom dev-dependencies #1590

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

blaggacao
Copy link
Contributor

No description provided.

@blaggacao
Copy link
Contributor Author

blaggacao commented Oct 26, 2024

Copy link

sonarcloud bot commented Oct 26, 2024


pyroject_config = loads(open(pyproject_path).read())
for key, deps in pyroject_config["project"]["optional-dependencies"].items():
bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade {' '.join(deps)}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose this could just be moved into the function that installs the apps instead

bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade -e './apps/{app}[{', '.join(pyroject_config["project"]["optional-dependencies"])}]'

Let pip worry about the entire env management

Given we are using the standard to define optional dependencies, I wonder if we could just retire bench.dev-dependencies in favour of the standard.

Copy link
Contributor Author

@blaggacao blaggacao Oct 30, 2024

Choose a reason for hiding this comment

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

I suppose this could just be moved into the function that installs the apps instead

If "install app" can be equated to "install optional deps, as well", then yes, indeed.

retire tools.bench.dev-dependencies

Yes that makes sense, absolutely!

Copy link
Collaborator

Choose a reason for hiding this comment

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

For development setups, installing optional dependencies should be ok, although if I go through the effort of making separate groups, I would expect more control.

So, I'm not sure automatically installing the different "optional-dependencies" groups would be the best course of action. Passing --install-optional-dependencies=dev,test sounds like a saner path to take, also adding a warning/info if developer_mode is enabled on bench and optional-dependencies are present in app pyproject.toml.

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.

2 participants