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

package pylint or other python tools #14099

Open
1 task done
gsemet opened this issue Jun 15, 2023 · 1 comment
Open
1 task done

package pylint or other python tools #14099

gsemet opened this issue Jun 15, 2023 · 1 comment
Assignees

Comments

@gsemet
Copy link

gsemet commented Jun 15, 2023

What is your question?

Hi

I am looking for a way to package pylint or any other opensource or closed source python script so that they would be available through conan development environement + cmake for the developers.

For instance when developers has a small python script to execute, it would be good if it would have been directly available as a cmake target like they already does, except this is not integrated as a conan package (we have a bunch of tools user needs to manually install).

I would not want to install anything in the environment where conan is installed itself.

For exemple, let's say I want to distribute a pylint package with predefined configuration file + cmake scripts in conan. I though to create a "zipapp" of the pylint (an self-containing executable with all the depedendencies attached in a big zip file), for instance using shiv. And then work on the conan recipe to provide the config + the cmake target with the right call to launch the zipapp using the same interpreter than the one used by conan.

Does it makes sense, or does anyone already tried it ?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Jun 15, 2023
@memsharded
Copy link
Member

Hi @gsemet

I am looking for a way to package pylint or any other opensource or closed source python script so that they would be available through conan development environement + cmake for the developers.

As long as it is wrapping some python files in a Conan package, it is totally doable, for example it is what the meson recipe in ConanCenter is doing: https://github.com/conan-io/conan-center-index/tree/master/recipes/meson/all, creating a .cmd or shell script as a launcher for the tool and doing a chmod +x on it. It is also very possible to put python code inside python_requires to be reused in recipes.

The problem is if those files have dependencies, like pip installed dependencies. That is a problem, because it is not possible to install them without affecting the current Python environment where Conan is running. There is some ongoing contribution for Conan 2.X in #11601, but this is not a simple feature, so it will take some time, but I think you want to track that feature.

In any case, it is possible to put something like a full toolchain, the android-ndk and similar things inside conan packages and use them as tool-requires, so I see no prob with packaging things that are executable (with runtime dependencies if necessary) inside a Conan package and then using them, as long as they do not need to modify the Python environment.

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

No branches or pull requests

2 participants