Skip to content

Commit

Permalink
Merge pull request #302 from n-kawauchi/for_python312
Browse files Browse the repository at this point in the history
distutils廃止のためsetup.pyを修正
  • Loading branch information
n-ando authored Aug 28, 2023
2 parents 48b53c4 + 015a3d9 commit 739e2ab
Show file tree
Hide file tree
Showing 16 changed files with 4,816 additions and 1,365 deletions.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
include OpenRTM-aist.pth
include MANIFEST.in
include setup.py
include setup.cfg
include pyproject.toml
include README
exclude README.md
recursive-include packages Makefile
recursive-include packages/deb *.sh copyright changelog rules README* compat control control.* files
recursive-include packages/rpm *.sh openrtm-aist.spec.in openrtm-aist_py3.spec.in
Expand Down
2,416 changes: 2,354 additions & 62 deletions OpenRTM_aist/docs/Doxyfile_en.in

Large diffs are not rendered by default.

2,412 changes: 2,352 additions & 60 deletions OpenRTM_aist/docs/Doxyfile_jp.in

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions OpenRTM_aist/docs/Makefile

This file was deleted.

19 changes: 19 additions & 0 deletions OpenRTM_aist/docs/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

VERSION=2.0.2

if [ -e Doxyfile_en ]; then
rm Doxyfile_en
rm -rf ClassReference-en
fi
if [ -e Doxyfile_jp ]; then
rm Doxyfile_jp
rm -rf ClassReference-jp
fi

sed -e "s/__VERSION__/${VERSION}/g" Doxyfile_en.in > Doxyfile_en
sed -e "s/__VERSION__/${VERSION}/g" Doxyfile_jp.in > Doxyfile_jp

doxygen Doxyfile_en
doxygen Doxyfile_jp

2 changes: 1 addition & 1 deletion OpenRTM_aist/utils/rtc-template/rtc-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import yaml
import copy

from distutils.sysconfig import get_python_lib
from setuptools._distutils.sysconfig import get_python_lib

default_profile = """
rtcProfile:
Expand Down
16 changes: 0 additions & 16 deletions OpenRTM_aist/utils/rtcd/py2exe/setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions OpenRTM_aist/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

openrtm_name = "OpenRTM-aist-2.0.1"
openrtm_version = "2.0.1"
openrtm_version = "2.0.2"
openrtm_name = "OpenRTM-aist-" + openrtm_version
corba_name = "omniORB"
9 changes: 0 additions & 9 deletions packages/Makefile

This file was deleted.

6 changes: 6 additions & 0 deletions packages/deb/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
openrtm2-python3 (2.0.2-0) experimental; urgency=low

* 2.0.2-0 (2.0.2-RELEASE). OpenRTM-aist-2.0.2-RELEASE

-- Noriaki Ando <n-ando@aist.go.jp> Thu, 13 Jul 2023 17:33:38 +0900

openrtm2-python3 (2.0.1-1) experimental; urgency=low

* Fixed separate properties.
Expand Down
4 changes: 0 additions & 4 deletions packages/deb/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ Depends: openrtm2-python3
Description: OpenRTM-aist-Python examples
Example components and sources of OpenRTM-aist.

Package: openrtm2-python3-doc
Architecture: all
Description: Documentation for openrtm2-python3
Class reference manual of OpenRTM-aist.
29 changes: 19 additions & 10 deletions packages/deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# short version number
SHORT_VER := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p' | cut -b 1-3)

TARGET = $(CURDIR)/debian/openrtm2-python3/usr
TARGET_example = $(CURDIR)/debian/openrtm2-python3-example/usr/share/openrtm-$(SHORT_VER)/components/python3

configure: configure-stamp
configure-stamp:
dh_testdir
Expand All @@ -18,7 +24,7 @@ configure-stamp:


build: build-stamp
python3 setup.py build
# python3 setup.py build

build-stamp: configure-stamp
dh_testdir
Expand All @@ -28,7 +34,6 @@ clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
python3 setup.py clean

dh_clean

Expand All @@ -38,14 +43,18 @@ install: build
dh_clean -k
dh_installdirs

# installing core
python3 setup.py install_core --prefix=$(CURDIR)/debian/openrtm2-python3/usr --install-layout=deb
# installing examples
(mkdir $(CURDIR)/debian/openrtm2-python3-example/usr/)
python3 setup.py install_example --install-dir=$(CURDIR)/debian/openrtm2-python3-example/usr/
# installing examples
(mkdir $(CURDIR)/debian/openrtm2-python3-doc/usr/)
python3 setup.py install_doc --install-dir=$(CURDIR)/debian/openrtm2-python3-doc/usr/
# for openrtm2-python3 package
(mkdir -p $(TARGET)/bin)
(cp $(CURDIR)/bin/rtc*2_python3 $(TARGET)/bin)
(mkdir -p $(TARGET)/lib/python3/dist-packages)
(cp -r $(CURDIR)/OpenRTM_aist $(TARGET)/lib/python3/dist-packages)
(cp -r $(CURDIR)/OpenRTM_aist*.dist-info $(TARGET)/lib/python3/dist-packages)
(cp $(CURDIR)/bin/OpenRTM-aist.pth $(TARGET)/lib/python3/dist-packages)

# for openrtm2-python3-example package
(mkdir -p $(TARGET_example))
(ls $(CURDIR))
(cp -r $(CURDIR)/examples/* $(TARGET_example))
dh_install -a

# Build architecture-independent files here.
Expand Down
44 changes: 30 additions & 14 deletions packages/deb/dpkg_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,42 @@ check_distribution()

get_version_info()
{
VERSION=`python3 ../../setup.py --version`
VERSION=`dpkg-parsechangelog --show-field Version | cut -b 1-5`
SHORT_VERSION=`echo $VERSION | sed 's/\.[0-9]*$//'`
BUILD_ROOT="buildroot"
PKG_NAME="OpenRTM-aist-Python-${VERSION}"
}

create_source_package()
{
cd ../../
python3 setup.py build
python3 setup.py sdist
cd -
}

extract_source()
{
tar xvzf ../../dist/${PKG_NAME}.tar.gz
mv ${PKG_NAME} ${BUILD_ROOT}
mkdir ${BUILD_ROOT}
cp -r ../../examples ${BUILD_ROOT}/
cp -r ../../OpenRTM_aist* ${BUILD_ROOT}/
find ${BUILD_ROOT}/examples | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
find ${BUILD_ROOT}/examples -name "*.bat" | xargs rm -f
rm ${BUILD_ROOT}/examples/rtc.conf.sample
rm ${BUILD_ROOT}/OpenRTM_aist/RTM_IDL/*.pth
rm -rf ${BUILD_ROOT}/OpenRTM_aist/RTM_IDL/ext
rm -rf ${BUILD_ROOT}/OpenRTM_aist/docs
rm -rf ${BUILD_ROOT}/OpenRTM_aist/ext/sdo/observer/test
rm ${BUILD_ROOT}/OpenRTM_aist/ext/extended_fsm/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/ext/fsm4rtc_observer/*.idl
rm ${BUILD_ROOT}/OpenRTM_aist/ext/fsm4rtc_observer/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/ext/fsm4rtc_observer/setup.*
rm ${BUILD_ROOT}/OpenRTM_aist/ext/http/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/ext/logger/fluentlogger/*.conf
rm -rf ${BUILD_ROOT}/OpenRTM_aist/ext/ssl/test
rm ${BUILD_ROOT}/OpenRTM_aist/ext/ssl/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/ext/transport/OpenSplice/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/ext/transport/ROS2Transport/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/ext/transport/ROSTransport/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/utils/rtcd/README
rm ${BUILD_ROOT}/OpenRTM_aist/utils/rtcd/*.conf
rm ${BUILD_ROOT}/OpenRTM_aist/utils/rtcd/*.bat
rm ${BUILD_ROOT}/OpenRTM_aist/utils/rtcd/rtcd2_python3
rm ${BUILD_ROOT}/OpenRTM_aist/utils/rtcprof/*.bat
rm ${BUILD_ROOT}/OpenRTM_aist/utils/rtcprof/rtcprof2_python3
cp -r ../../local/bin ${BUILD_ROOT}/
chmod -x ${BUILD_ROOT}/bin/*.pth
}

create_files()
Expand All @@ -135,7 +153,6 @@ create_files()
cat << EOF >> debian/files
openrtm2-python3_${PKG_VERSION}_${ARCH}.deb main extra
openrtm2-python3-example_${PKG_VERSION}_${ARCH}.deb main extra
openrtm2-python3-doc_${PKG_VERSION}_all.deb main extra
EOF
}

Expand Down Expand Up @@ -178,7 +195,6 @@ check_distribution
get_version_info

cleanup_files
create_source_package
extract_source
create_files
copy_control_files
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["RTM-Python-build-idl@git+https://github.com/OpenRTM/RTM-Python-build-idl", "wheel", "setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
20 changes: 20 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[metadata]
name = OpenRTM-aist-Python
version = attr: OpenRTM_aist.version.openrtm_version
author = Shinji Kurihara and Noriaki Ando
author_email = n-ando@aist.go.jp
license = LGPL
description = Python modules for OpenRTM-aist
url = http://openrtm.org/
long_description = README.md

[options]
packages = find_namespace:
zip_safe = True
include_package_data = True

scripts =
OpenRTM_aist/utils/rtcd/rtcd2_python3
OpenRTM_aist/utils/rtcprof/rtcprof2_python3
OpenRTM_aist/RTM_IDL/OpenRTM-aist.pth

Loading

0 comments on commit 739e2ab

Please sign in to comment.