Conversation
...instead of using subprocess.run() to run a hatch CLI command, which can be tricky and error prone to extract the output from
|
Nice - this is a great solution. Any idea how far back the |
|
I see it is present in Hatch 1.6 and maybe even previous versions (did not check) All the test suites for Hatch 1.7.x+ are passing so that shows everything is fine, doesn't it? |
|
This is an interesting one - AFAICT any environment collector plugins also need to be installed into the I need to work on reproducing some issues I saw with this |
|
@juftin Any news? :) |
|
@valentinoli sorry for not following up. It looks like the The following script raises an error: cd $(mktemp -d)
git clone https://github.com/mkdocs/mkdocs
cd mkdocs
uv tool run git+https://github.com/valentinoli/hatch-pip-compile@patch-3 docswhereas the current hatch-pip-compile method handles the bootstrapping of any required plugins cd $(mktemp -d)
git clone https://github.com/mkdocs/mkdocs
cd mkdocs
uv tool run hatch-pip-compile docs |
|
Just spitballing, but maybe there's a method you can call on the Project class that would install any required plugins? |
|
Ah I see. Since this Project class is undocumented and part of Hatch core (which is prone to change without notice) it might be a bad idea It is probably safer to stick with #95 |
Get the set of environments by using
hatch.coreinstead of usingsubprocess.run()to run a hatch CLI command. The stdout from the subprocess can be tricky to parse correctly due to side-effects, e.g. output printed by an environment collector plugin.