-
-
Notifications
You must be signed in to change notification settings - Fork 26
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Aliases configuration file #205
Comments
To give you some context, I am currently using this file (
and this command when running check:
|
I like your ideas @Peder2911! I think it would make a lot of sense to have that in a TOML file, in a similar way as when configuring other tools (such as mypy). Some of the aliases in your list I would expect the tool to figure out without it, I will have a look at this. Edit: probably because of the |
Meanwhile, would it be an option to use the Rye |
Oh cool, I wasn't aware of rye scripts. That's a good solution! |
I have a similar problem with the Google Cloud libraries specifically, though there are more examples out there in the PyPI. When we add a couple of the Google libraries to the dependencies list, dependencies = [
"google-cloud-storage",
"google-cloud-bigquery",
] we will need to use them like this, according to their examples and docs: from google.cloud import storage
from google.cloud import bigquery
bigquery_client = bigquery.Client()
storage_client = storage.Client() In the current Polylith state, it would cause an issue with the
Introspecting the dependencies metadata with the >>> from importlib.metadata import packages_distributions
>>> packages_distributions()["google"]
['google-api-core', 'protobuf', 'google-cloud-bigquery-storage', 'google-resumable-media', 'google-cloud-storage', 'google-auth', 'google-cloud-core', 'google-cloud-bigquery', 'googleapis-common-protos'] The downside of this approach is that I can use the |
Maybe using the rye feature is a good-enough solution, what do you think? (I haven't tried this out properly, though) [tool.rye.scripts]
check = { cmd = [
"poly",
"check",
"--alias", "pyyaml=yaml,opentelemetry-instrumentation=opentelemetry, opentelemetry-instrumentation-fastapi=opentelemetry, opentelemetry-instrumentation-aiohttp-client=opentelemetry, opentelemetry-distro[otlp]=opentelemetry, opentelemetry-instrumentation=opentelemetry, pydantic-settings=pydantic_settings, azure-identity=azure, pydantic[email]=pydantic",
"--strict"]} |
Great input @svartalf! I will try this out using the Google packages and try to find a solution. |
@svartalf I just tried with the google libraries and the |
|
Oh, sorry. I must have missed this one. If you want to add something within Polylith, I think that the pyproject.toml at the root might be a good option! I also think that the already existing rye scripts option could be a candidate for solving this issue. I'm not happy with how the |
@svartalf Will using the I am guessing that you use the Example
Running the commands without the |
(moving this to the 💡 discussions section) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is your feature request related to a problem? Please describe.
The current way of providing aliases via the
--alias
flag does not provide any reliable way to share or replicate aliases between team members.Describe the solution you'd like
My current workaround is to maintain the aliases in a file inside of the repo (
.aliases
). It would be good if the tool supported this natively.Describe alternatives you've considered
I feel like it would be a good idea if the
poly
CLI either could accept a file containing newline-separated aliases directly, or if it had a configuration setting in a TOML file somewhere where one could set the aliases. I would like to hear your opinion on whether this configuration should happen in a separate file (i.e$USER/.poly.toml
or$(pwd)/poly.toml
) or whether it should be located in the development project pyproject file.Hope you like my idea! I could implement this and PR, i would just need to hear your preference between the above alternatives.
P
The text was updated successfully, but these errors were encountered: