Replies: 17 comments 12 replies
-
To give you some context, I am currently using this file (
and this command when running check:
|
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Meanwhile, would it be an option to use the Rye |
Beta Was this translation helpful? Give feedback.
-
Oh cool, I wasn't aware of rye scripts. That's a good solution! |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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"]} |
Beta Was this translation helpful? Give feedback.
-
Great input @svartalf! I will try this out using the Google packages and try to find a solution. |
Beta Was this translation helpful? Give feedback.
-
@svartalf I just tried with the google libraries and the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
@svartalf Will using the I am guessing that you use the Example
Running the commands without the |
Beta Was this translation helpful? Give feedback.
-
(moving this to the 💡 discussions section) |
Beta Was this translation helpful? Give feedback.
-
Update: there's a new version of the Polylith CLI, that I believe solves the issues with locating the third-party dependencies that is put in sub-namespaces of a global one, such as This would also remove the need to add the I hope this new version will solve your issues, if they still are relevant, @Peder2911 and @svartalf! I would also appreciate if you have the time to test this out and share your feedback 🙏 EDIT: EDIT: |
Beta Was this translation helpful? Give feedback.
-
Ongoing work to make the dependency lookup more reliable (parsing project-specific lock files): https://github.com/DavidVujic/python-polylith/pull/220/files |
Beta Was this translation helpful? Give feedback.
-
I am coming across this issue with the python-jose package.
Check fails to pick it up (I am on poetry-polylith-plugin 1.23.0). Having the aliases as a list somewhere would be nice so they can be applied to all commands. The Could there be a place for this in say the |
Beta Was this translation helpful? Give feedback.
-
I ran into this with |
Beta Was this translation helpful? Give feedback.
-
Not sure if this should be working without an alias (alias is workable ATM) |
Beta Was this translation helpful? Give feedback.
-
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
Beta Was this translation helpful? Give feedback.
All reactions