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

Python build from source does not work #685

Open
ominiet opened this issue Aug 23, 2024 · 3 comments
Open

Python build from source does not work #685

ominiet opened this issue Aug 23, 2024 · 3 comments

Comments

@ominiet
Copy link

ominiet commented Aug 23, 2024

Description

If you prefer installing from source, you can run, from the source directory:
.. code:: bash
python -m build
pip install --user dist/yamllint-*.tar.gz

I have attempted to build the binary from source as mentioned in the above code snippet, however I receive an error when attempting the build.

path/to/python/python3.12: No module named build

Information

  • Platform - MacOS Sonoma 14.6.1
  • Python version 3.12.4

Steps to Reproduce

  1. git clone https://github.com/adrenverge/yamllint.git
  2. cd yamllint
  3. python3 -m build
@ominiet
Copy link
Author

ominiet commented Aug 23, 2024

After reviewing some further documentation, it seems like you will have to install the setuptools package from pip beforehand in order to generate the build file.

I found the reference in this document here:
https://setuptools.pypa.io/en/latest/userguide/quickstart.html

Potentially this section should read

pip install --user setuptools build 
python -m build
pip install --user dist/yamllint-*.tar.gz

@adrienverge
Copy link
Owner

Thanks for the report. This is interesting, which pip version are you using? Setuptools should only be required on old versions (it's used in setup.py, which is kept for backward-compatibility with old versions that don't know pyproject.toml).

@ominiet
Copy link
Author

ominiet commented Aug 26, 2024

My version of pip is:
24.0

I see that the build-system of setup-tools is defined here in pyroject.toml and when I run the given build command I do see:

Requirement already satisfied: pathspec>=0.5.3 in (path/to/site-packages) (from yamllint==1.35.1)  (0.12.1)
Requirement already satisfied: pyyaml in (path/to/site-packages) (from yamllint==1.35.1) (6.0.2)

(I had already successfully run the build previously)

So it looks like the config is being being read properly since that's the only location I see the dependencies defined, but for some reason it doesn't install required build tool.

I'm not a python dev so it may be a simple misunderstanding from my end. Please let me know if there is a simple solution and if this is something I should have known or done differently.

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