ussserrr / stm32pio

Automate managing of STM32CubeMX + PlatformIO projects
https://pypi.org/project/stm32pio
Other
224 stars 24 forks source link

Download the tar.gz from release tag but can't install, but clone the repo directly can #28

Closed svenikea closed 3 years ago

svenikea commented 3 years ago

Machine Information

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

But I was able to install it by cloning the repo directly like this

git clone https://github.com/ussserrr/stm32pio.git cd stm32pio python setup.py install --user sudo ln -s ~/.local/bin/stm32pio /usr/bin/stm32pio

ussserrr commented 3 years ago

Did you try the recommended command from the README?

$ tar -xf stm32pio-2.1.0.tar.gz
$ cd stm32pio-2.1.0
$ pip install .

Btw, these tar.gz and zip archives are auto-generated by GitHub every time I issue a new release, they are just packed snapshots of the repository root and not some kind of built wheels or something like this.

svenikea commented 3 years ago

Nope mate, I'm still getting the same error but in different variant

    LookupError: setuptools-scm was unable to detect version for '/tmp/pip-req-build-nscicne9'.

    Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

    For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python /usr/lib/python3.9/site-packages/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpayzup4cz Check the logs for full command output.

I just checked out the the repo's version, up to v1.30. I was able to successfully install with pip install . or python setup.py install, version 2.0.0 and up failed to install

ussserrr commented 3 years ago

OK, I got it. Starting from v2.0.0 the app version is not hardcoded or listed anywhere in the project files and specified only as a git repository tag. That's what the setuptools-scm package is used for after all. So, in order to install from source you need to either clone the repo (you've already figured it out) or, if you decided to download the tar.gz, just use it in "portable" (not installed) manner (or create your own git repository inside the folder).

Also, if you want to build a Python wheel or sdist, take a look at CONTRIBUTING guide.

svenikea commented 3 years ago

Thanks, mate. I think I'll just gonna clone the repo directly from now with the latest release of course. AUR package updated. Thank you for your time mate and happy coding. Closing this issue now.