COVESA / vss-tools

Software for working with VSS (https://github.com/COVESA/vehicle_signal_specification)
Mozilla Public License 2.0
55 stars 55 forks source link

Package vss-tools and publish to PyPi index #75

Closed gunnarx closed 1 year ago

gunnarx commented 3 years ago

Discussion around the topic ^^

barbieri commented 3 years ago

https://pypi.org/project/vss/ exists but is not this package, so I'd like to propose us to register the official project and publish the package (since bb593541cd35ef19c1b992bf84f7e2e5d29d0464 it's doable).

  1. Register your user and project at https://pypi.org/
  2. generate the packages (ie: setup.py bdist_egg bdist_wheel)
  3. upload to pypi using twine
rm -fr dist/ build
./setup.py egg_info -Db '' sdist bdist_wheel bdist_egg

twine check dist/*.tar.gz || exit 1
twine upload dist/*
barbieri commented 3 years ago

@danielwilms , @SebastianSchildt , @erikbosch care to comment? :-)

SebastianSchildt commented 3 years ago

I can not do this, but I think it would be a nice thing, if people can just "pip install" VSS tools.

We are doing this for the kuksa.val client libraries already : https://pypi.org/project/kuksa-viss-client/ and while it is not our "make or break" feature it is neat 😀

With Github Actions, it should even be possible to automate this for tagged releases. So my position would be as @barbieri is knowledgable in these things, please feel encouraged to do this 😁

(I think @gunnarx should register at pypi (so this remains in "Genivi's hands", and then just throw they keys over to @barbieri 🔑 )

barbieri commented 3 years ago

I don't need/want the keys :-) For me, GitHub actions that automate the process, such as when we create a tag or some branch name (ie: release/) then it runs the release process and uses twine to upload to pypi.

gunnarx commented 3 years ago

OK. I don't know the pypi process, but I would be willing to find out.

barbieri commented 3 years ago

@gunnarx it's this, based on https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives

  1. install twine python3 -m pip install --upgrade twine
  2. create your user (personal): https://pypi.org/account/register/ (recommended to add 2fa and all)
  3. to automate stuff you may issue an API Token at https://pypi.org/manage/account/
  4. vss-tool's setup.py requires a git tag, so create one that will be used as version (ex: 0.1.0)
  5. generate the files to be distributed: python3 setup.py sdist bdist_wheel bdist_egg (source distribution, binary distribution as wheel, binary distribution as egg)
  6. check the files before uploading twine check dist/vss-tools-* (currently it shows me some warnings about long_description_content_type and long_description, you can add or just ignore).
  7. upload files twine upload dist/vss-tools-*

Later on you can go to https://pypi.org/manage/projects/ and click the project's "Manage" button. You're going to see the releases, you can add collaborators (that's the way to get more people to help, not sharing passwords)

danielwilms commented 2 years ago

Meeting decision:

oliveirarleo commented 2 years ago

I believe that in order to publish at pypi we need to remove the editable = true in the Pipfile: https://github.com/COVESA/vss-tools/blob/487b135d7f74386bdc8c91c91e77548f09c7a681/Pipfile#L13

But unfortunately, when I did that, this error came up:

>> pipenv install --skip-lock
Installing dependencies from Pipfile...
An error occurred while installing git+https://github.com/GENIVI/vss-tools.git@master#egg=vss-tools! Will try again.
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 3/3 — 00:00:42
Installing initially failed dependencies...
[InstallError]:   File "/usr/lib/python3.9/site-packages/pipenv/cli/command.py", line 233, in install
[InstallError]:       retcode = do_install(
[InstallError]:   File "/usr/lib/python3.9/site-packages/pipenv/core.py", line 2052, in do_install
[InstallError]:       do_init(
[InstallError]:   File "/usr/lib/python3.9/site-packages/pipenv/core.py", line 1304, in do_init
[InstallError]:       do_install_dependencies(
[InstallError]:   File "/usr/lib/python3.9/site-packages/pipenv/core.py", line 899, in do_install_dependencies
[InstallError]:       batch_install(
[InstallError]:   File "/usr/lib/python3.9/site-packages/pipenv/core.py", line 796, in batch_install
[InstallError]:       _cleanup_procs(procs, failed_deps_queue, retry=retry)
[InstallError]:   File "/usr/lib/python3.9/site-packages/pipenv/core.py", line 703, in _cleanup_procs
[InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: Collecting vss-tools
[pipenv.exceptions.InstallError]:   Cloning https://github.com/GENIVI/vss-tools.git (to revision master) to /tmp/pip-install-yowcv3gd/vss-tools_49924331e158488280b5e94e21577af0
[pipenv.exceptions.InstallError]:   Resolved https://github.com/GENIVI/vss-tools.git to commit 22d9cea1ef33208c37e4660fee89d9da8cf1f090
[pipenv.exceptions.InstallError]:   Installing build dependencies: started
[pipenv.exceptions.InstallError]:   Installing build dependencies: finished with status 'done'
[pipenv.exceptions.InstallError]:   Getting requirements to build wheel: started
[pipenv.exceptions.InstallError]:   Getting requirements to build wheel: finished with status 'done'
[pipenv.exceptions.InstallError]:     Preparing wheel metadata: started
[pipenv.exceptions.InstallError]:     Preparing wheel metadata: finished with status 'done'
[pipenv.exceptions.InstallError]: Requirement already satisfied: deprecation>=2.1.0 in ./.venv/lib/python3.8/site-packages (from vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (2.1.0)
[pipenv.exceptions.InstallError]: Requirement already satisfied: stringcase>=1.2.0 in ./.venv/lib/python3.8/site-packages (from vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (1.2.0)
[pipenv.exceptions.InstallError]: Requirement already satisfied: anytree>=2.8.0 in ./.venv/lib/python3.8/site-packages (from vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (2.8.0)
[pipenv.exceptions.InstallError]: Requirement already satisfied: pyyaml>=5.1 in ./.venv/lib/python3.8/site-packages (from vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (5.4.1)
[pipenv.exceptions.InstallError]: Requirement already satisfied: six>=1.9.0 in ./.venv/lib/python3.8/site-packages (from anytree>=2.8.0->vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (1.16.0)
[pipenv.exceptions.InstallError]: Requirement already satisfied: packaging in ./.venv/lib/python3.8/site-packages (from deprecation>=2.1.0->vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (21.0)
[pipenv.exceptions.InstallError]: Requirement already satisfied: pyparsing>=2.0.2 in ./.venv/lib/python3.8/site-packages (from packaging->deprecation>=2.1.0->vss-tools->-r /tmp/pipenv-dsf9n2j_-requirements/pipenv-5if5tylo-requirement.txt (line 1)) (2.4.7)
[pipenv.exceptions.InstallError]: Building wheels for collected packages: vss-tools
[pipenv.exceptions.InstallError]:   Building wheel for vss-tools (PEP 517): started
[pipenv.exceptions.InstallError]:   Building wheel for vss-tools (PEP 517): finished with status 'done'
[pipenv.exceptions.InstallError]:   Created wheel for vss-tools: filename=vss_tools-22d9cea1-py3-none-any.whl size=32554 sha256=a4feeaf7e1d4614964bb4a9680670e101825a5ea6e3568d6ce93691b2c8914a6
[pipenv.exceptions.InstallError]:   Stored in directory: /tmp/pip-ephem-wheel-cache-4hs92go_/wheels/ae/b9/e1/fb64e9ca261fd5aa95e85208ed9665cdf39663c8830f5938a6
[pipenv.exceptions.InstallError]: Failed to build vss-tools
[pipenv.exceptions.InstallError]: Running command git clone -q https://github.com/GENIVI/vss-tools.git /tmp/pip-install-yowcv3gd/vss-tools_49924331e158488280b5e94e21577af0
[pipenv.exceptions.InstallError]:   WARNING: Built wheel for vss-tools is invalid: Metadata 1.2 mandates PEP 440 version, but '22d9cea1' is not
[pipenv.exceptions.InstallError]: ERROR: Could not build wheels for vss-tools which use PEP 517 and cannot be installed directly
ERROR: Couldn't install package: vss-tools
 Package installation failed...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/4 — 00:00:14
erikbosch commented 1 year ago

Process described at: https://github.com/COVESA/vss-tools/wiki/PyPI-packing and https://github.com/COVESA/vehicle_signal_specification/wiki/Release-Instructions-and-Checklist