Skip to content

Building python swig module fails due to either bad version written in version.mak or a bug in setup.py  #3969

Closed
@mahmood-alkhalil

Description

@mahmood-alkhalil

Describe the bug

upon cloning, and building with opus, and then trying to build python swig module i got this error

Traceback (most recent call last):
File "/root/pjproject/pjsip-apps/src/swig/python/setup.py", line 106, in
setup(name="pjsua2",
File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 146, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 318, in init
self.metadata.version = self._normalize_version(self.metadata.version)
File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 354, in _normalize_version
normalized = str(Version(version))
File "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/packaging/version.py", line 200, in init
raise InvalidVersion(f"Invalid version: '{version}'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: '2.14--dev'
make: *** [Makefile:42: _pjsua2.so] Error 1

so i modified the setup.py file that runs in the make process at line 59 to remove the concatenation of '-', then the building of swig worked

if pj_version_suffix:
     #pj_version += "-" + pj_version_suffix
     pj_version += pj_version_suffix 

not sure if the bug is in the setup.py or the version.mak file, but the version.mak file mentions to never be modified manually

Steps to reproduce

  1. clone master
  2. build pjsip
  3. build python swig module

PJSIP version

2.14

Context

building inside an ubuntu 20 container.

Log, call stack, etc

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions