Git Product home page Git Product logo

Comments (3)

diegoferigo avatar diegoferigo commented on June 17, 2024 1

I actually found a typo in the snippet I posted above. I was renaming the wheel from linux to manylinux. This is wrong, and we should rename it to manylinux1 in order to get accepted in PyPI.

So at this point we can distribute a manylinux wheel (🎉) even though it will not comply to the standard specifications. This means that using it in very old distributions likely will not work. Though, this is the case of many other packages as discussed here.

@traversaro

from gym-ignition.

diegoferigo avatar diegoferigo commented on June 17, 2024

In #55 I tried to implement an initial support of bdist packages, but due to the complexity of creating a manylinux release I limited the scope of that PR of only sdist.

Here below I report the Github Actions section to generate a linux release.

bdist section in pypi.yml
  # ===================
  # BDIST_WHEEL PACKAGE
  # ===================

  bdist:
    name: bdist_wheel
    strategy:
      matrix:
        os:
          - ubuntu-latest
        python_version:
          - 3.6
    runs-on: ${{ matrix.os }}
    container:
      image: diegoferigo/gym-ignition:ci
      env:
        CC: gcc
        CXX: g++
        PYTHON_VERSION: ${{ matrix.python_version }}

    steps:
      - uses: actions/checkout@master

      # Validate the last tag accordingly to PEP440
      # From https://stackoverflow.com/a/37972030/12150968
      - name: Validate Tag for PEP440 compliance
        run: |
          apt-get update
          apt-get install -y source-highlight
          last_tag="$(git describe --abbrev=0 --tags)"
          rel_regexp='^(\d+!)?(\d+)(\.\d+)+([\.\-\_])?((a(lpha)?|b(eta)?|c|r(c|ev)?|pre(view)?)\d*)?(\.?(post|dev)\d*)?$'
          echo ""
          echo $last_tag
          echo ""
          check-regexp ${rel_regexp} ${last_tag}
          match=$(check-regexp ${rel_regexp} ${last_tag} | grep matches | cut -d ' ' -f 5)
          test $match -eq 1 && true

      # The entrypoint is not called because it is overridden by GH Actions.
      # Even using the 'jobs.<job_id>.container.options' does not work because the
      # entrypoint of GH Actions overrides the one passed through YAML.
      - name: Execute entrypoint
        run: . /entrypoint.sh

      - name: Create package
        run: python setup.py bdist_wheel

      #
      # We should discuss about an extended support of linux distributions, switching to
      # a manylinux wheel.
      #
      # - https://opensource.com/article/19/2/manylinux-python-wheels
      # - https://thomastrapp.com/blog/building-a-pypi-package-for-a-modern-cpp-project/
      #
      # - name: Rename wheel
      #   run: |
      #     apt-get update
      #     apt-get install -y rename
      #     cd dist
      #     find -type f -name '*.whl' -exec rename.ul linux manylinux {} +

      - name: Install and test
        run: |
          cd dist
          pip install gym_ignition-*_x86_64.whl
          cd ../tests/python
          module_path=$(python -c "import gym_ignition ; print(gym_ignition.__path__[0])")
          module_path=$(echo $module_path | cut -d ' ' -f 1)
          export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=${module_path}/plugins
          data_path=$(python -c "import gym_ignition_data ; print(gym_ignition_data.__path__[0])")
          export IGN_GAZEBO_RESOURCE_PATH=${data_path}:${data_path}/worlds
          pytest || true

      - name: Install twine
        if: github.event.action == 'published'
        run: pip install twine

      - name: Push to PyPI
        if: github.event.action == 'published'
        run: |
          env
          twine upload --verbose dist/*
        env:
          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

from gym-ignition.

diegoferigo avatar diegoferigo commented on June 17, 2024

It would be really cool if the user could avoid to install all the ignition Robotics libraries. We could statically compile in our setup all the gym-ignition dependencies so that the bindings shared object would be standalone. However, due to the (really cool) plugin system of Ignition, this would not work because the Ignition plugins cannot be statically linked.

A big advantage of such approach was that the PyPI package would have been standalone, and rolling back to a old gazebo version could have been possible just by pulling an old PyPI release.

Considering that this is not doable, we will always need users to install separately Ignition Gazebo from the official PPA. At this point, we have to be quite careful with the bdist release because we need to find in the user setup a target system which is ABI-compatible with the one used to create the bdist archive. Likely this means that our releases will work only with (and I hope at least with) a given Ignition Robotics major release (Blueprint, at the time of writing).

from gym-ignition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.