diff --git a/.github/workflows/wheel-linux.yml b/.github/workflows/wheel-linux.yml index 12648ced2b5d..fb1f5eafc5b1 100644 --- a/.github/workflows/wheel-linux.yml +++ b/.github/workflows/wheel-linux.yml @@ -35,8 +35,10 @@ jobs: - name: Building helper wheels for later tests run: | cd tools - python build/setup-sumolib.py bdist_wheel - python build/setup-traci.py bdist_wheel + python build/version.py build/setup-sumolib.py ./setup.py + python -m build --sdist --wheel + python build/version.py build/setup-traci.py ./setup.py + python -m build --sdist --wheel - name: Uploading artifacts (Helper wheels) uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index 906f52ac03ec..106a3f14dee5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /mirror /share /dist +/setup.py # IDE project files /.settings /.cproject @@ -115,6 +116,7 @@ /tools/libsumo/libsumo.py /tools/libtraci/_libtraci.* /tools/libtraci/libtraci.py +/tools/setup.py # extracted tests /tests/_* # netedit test diff --git a/build/pyproject.toml b/build/pyproject.toml new file mode 100644 index 000000000000..6da67be8e1c5 --- /dev/null +++ b/build/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ "setuptools>=42", + "scikit-build>=0.13", + "cmake>=3.18", + "ninja", +] +build-backend = "setuptools.build_meta" diff --git a/tools/build/build_wheels.sh b/tools/build/build_wheels.sh index ced1e0d61397..ed12a2b2348e 100755 --- a/tools/build/build_wheels.sh +++ b/tools/build/build_wheels.sh @@ -26,23 +26,27 @@ if test -z $HTTPS_PROXY; then yum install -y --nogpgcheck ccache libxerces-c-devel proj-devel fox16-devel bzip2-devel gl2ps-devel swig3 pipx install -f patchelf==0.16.1.0 # see https://github.com/pypa/manylinux/issues/1421 fi -/opt/python/cp38-cp38/bin/pip install scikit-build cmake mkdir -p $HOME/.ccache echo "hash_dir = false" >> $HOME/.ccache/ccache.conf echo "base_dir = /github/workspace/_skbuild/linux-x86_64-3.8" >> $HOME/.ccache/ccache.conf -/opt/python/cp38-cp38/bin/python tools/build/setup-sumo.py -j 8 bdist_wheel +cp build/pyproject.toml . +py=/opt/python/cp38-cp38 +$py/bin/python tools/build/version.py tools/build/setup-sumo.py ./setup.py +$py/bin/python -m build --wheel mv dist/eclipse_sumo-* `echo dist/eclipse_sumo-* | sed 's/cp38-cp38/py2.py3-none/'` auditwheel repair dist/eclipse_sumo*.whl cp -a data tools/libsumo for py in /opt/python/cp3[1789]*; do - rm dist/*.whl - $py/bin/pip install scikit-build + rm tools/dist/*.whl pminor=`echo $py | sed 's,/opt/python/cp3,,;s/-.*//'` echo "base_dir = /github/workspace/_skbuild/linux-x86_64-3.${pminor}" >> $HOME/.ccache/ccache.conf - $py/bin/python tools/build/setup-sumo.py -j 8 bdist_wheel - $py/bin/python tools/build/setup-libsumo.py bdist_wheel - $py/bin/python tools/build/setup-libtraci.py bdist_wheel - auditwheel repair dist/libsumo*.whl - auditwheel repair dist/libtraci*.whl + $py/bin/python tools/build/version.py tools/build/setup-sumo.py ./setup.py + $py/bin/python -m build --wheel + $py/bin/python tools/build/version.py tools/build/setup-libsumo.py tools/setup.py + $py/bin/python -m build --wheel tools + $py/bin/python tools/build/version.py tools/build/setup-libtraci.py tools/setup.py + $py/bin/python -m build --wheel tools + auditwheel repair tools/dist/libsumo*.whl + auditwheel repair tools/dist/libtraci*.whl done diff --git a/tools/build/setup-sumo.py b/tools/build/setup-sumo.py index 6919fa9cf6c2..15ffaa9532cd 100755 --- a/tools/build/setup-sumo.py +++ b/tools/build/setup-sumo.py @@ -20,7 +20,9 @@ import version SUMO_VERSION = version.get_pep440_version() -package_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +sumo_dir = os.path.abspath(os.path.dirname(__file__)) +while not os.path.exists(os.path.join(sumo_dir, 'README.md')) and sumo_dir != os.path.dirname(sumo_dir): + sumo_dir = os.path.dirname(sumo_dir) setup( name='eclipse-sumo', @@ -31,7 +33,7 @@ author_email='sumo@dlr.de', license='EPL-2.0', description=("A microscopic, multi-modal traffic simulation package"), - long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(), + long_description=open(os.path.join(sumo_dir, 'README.md')).read(), long_description_content_type='text/markdown', classifiers=[