Skip to content

Commit 22d8b3b

Browse files
authored
Merge pull request #875 from DLR-RM/develop
Updates from AgileRobotsAG to version 2.0.0
2 parents 608c481 + 0bffdd0 commit 22d8b3b

File tree

730 files changed

+13097
-8245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

730 files changed

+13097
-8245
lines changed

.bumpversion.cfg

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[bumpversion]
2+
current_version = 2.0.0
3+
4+
[bumpversion:glob:**/pyproject.toml]
5+
search = version = "{current_version}" # Handled by bump2version
6+
replace = version = "{new_version}" # Handled by bump2version
7+
8+
[bumpversion:file:VERSION]
9+
search = {current_version}
10+
replace = {new_version}
11+
12+
[bumpversion:file:CITATION.cff]
13+
search = version: {current_version} # Handled by bump2version
14+
replace = version: {new_version} # Handled by bump2version

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,10 @@ dart-sass
147147
dart-sass*
148148
*.css.map
149149

150+
# pdm tool
151+
.pdm-python
152+
# ignore requirements as this is this only needed for make docs and is then generated by pdm
153+
requirements.txt
154+
155+
# do not ignore bump2version config
156+
!.bumpversion.cfg

.gitlab-ci.yml

+55-13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ include:
44
ref: 'release/3.x'
55
file:
66
- '/ci/templates/default.yml'
7+
- '/ci/templates/python/default.yml'
78

89
variables:
910
AR_CI_CLANG_FORMAT_DISABLE: "true"
@@ -30,12 +31,14 @@ variables:
3031

3132
docs_test:
3233
extends: .docs_test
34+
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
3335
variables:
3436
BUILD_DIR: build
3537
CONAN_OPTIONS: ""
3638
MAKE_CMD_DOCS: "make docs"
3739

3840
pages:
41+
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
3942
extends: .docs_pages
4043
variables:
4144
BUILD_DIR: build
@@ -52,11 +55,12 @@ pages:
5255
test py3-tests: &test-py3-tests
5356
<<: *only-default
5457
stage: Test
58+
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
5559
tags:
5660
- Agile_GUI_Docker
5761
script:
58-
- pip3 install tox
59-
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e py36
62+
- pip3 install tox pdm
63+
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e py310
6064
coverage: /^TOTAL.+?(\d+\%)$/
6165
artifacts:
6266
expire_in: 7 days
@@ -68,10 +72,11 @@ test py3-tests: &test-py3-tests
6872
test py3-tests-core:
6973
<<: *only-default
7074
stage: Test
75+
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
7176
tags:
7277
- Agile_GUI_Docker
7378
script:
74-
- pip3 install tox
79+
- pip3 install tox pdm
7580
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e core
7681
coverage: /^TOTAL.+?(\d+\%)$/
7782
artifacts:
@@ -84,23 +89,60 @@ test py3-tests-core:
8489
test py3-memory-test-core:
8590
<<: *only-default
8691
stage: Test
92+
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
8793
tags:
8894
- Agile_GUI_Docker
8995
script:
90-
- pip3 install tox
96+
- pip3 install tox pdm
97+
- pdm install --dev --no-editable
9198
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e memory_core
9299
artifacts:
93-
expire_in: 7 days
100+
expire_in: 7 days
94101

102+
Pip::build pure:
103+
variables:
104+
AR_PYTHON_PACKAGE_WHEEL_DIR: "${CI_PROJECT_DIR}/wheels"
105+
before_script:
106+
- python3 -m pip install -U pip
107+
- export AR_PYTHON_PACKAGE_ROOT_DIR="${CI_PROJECT_DIR}/${AR_PYTHON_PACKAGE_ROOT_DIR_SUFFIX}"
108+
parallel:
109+
matrix:
110+
- AR_PYTHON_PACKAGE_ROOT_DIR_SUFFIX: [".", "source"]
95111

96-
# running pytest directly does not work
97-
# as the test_start_script.py test_start_script_valid_config always uses "python" to start "rafcon_core"
98-
# which fails if tests are run using python3 as the "python" always maps to python2 on Ubuntu 18.04
99-
# - xvfb-run -as "-screen 0 1920x1200x24" python3 setup.py pytest --addopts '-vx -m "(core or guqi) and not unstable and not user_input"'
112+
Test Rafcon Core Python Wheel:
113+
stage: Test
114+
<<: *only-default
115+
needs: [ "Pip::build pure" ]
116+
dependencies: [ "Pip::build pure" ]
117+
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
118+
script:
119+
- python3 -m pip install -U pip pytest pytest-timeout
120+
- python3 -m pip install wheels/rafcon_core*.whl
121+
- python3 -m pytest tests/core
122+
123+
Pip::test on Linux:
124+
before_script:
125+
# These apt packages are needed by the rafcon pip package for installation
126+
- apt update && apt install -y libcairo2 libcairo2-dev build-essential libgirepository1.0-dev
127+
parallel:
128+
matrix:
129+
- PYTHON_IMAGE:
130+
- artifactory.ar.int:5000/ar-python-slim:3.7.16
131+
- artifactory.ar.int:5000/ar-python-slim:3.8.16
132+
- artifactory.ar.int:5000/ar-python-slim:3.9.16
133+
- artifactory.ar.int:5000/ar-python-slim:3.10.10
100134

101-
Test Python Upcoming:
102-
<<: *test-py3-tests
135+
Pip::test on Windows:
136+
rules:
137+
- when: never
138+
139+
Version Test:
140+
<<: *only-default
141+
stage: Test
103142
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
104143
script:
105-
- pip3 install tox
106-
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e py310
144+
# Check if it is possible to bump version
145+
# e.g. all versions in files are the same and eq
146+
# to version in .bumpversion.cfg
147+
- pip install pdm
148+
- make version_test

CHANGELOG.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ details can be found in the `GIT commit log <https://github.com/DLR-RM/RAFCON/co
77
Future Release
88
"""""""
99

10+
2.0.0
11+
""""""
12+
- Features:
13+
- Switch from setup.py to pyproject.toml and pdm for the python package management
14+
- Add bump2version to avoid human errors when updating the rafcon version
15+
- Added auto-layout functionality (as a first version)
16+
17+
1.3.0
18+
"""""""
19+
- Features:
20+
Add possibility to only release rafcon-core
21+
1022
1.2.1
1123
"""""""
1224
- Features:
@@ -1726,4 +1738,4 @@ Patch releases 0.2.\*
17261738
"""""
17271739

17281740
- First release version
1729-
- Tool was renamed to RAFCON
1741+
- Tool was renamed to RAFCON

CITATION.cff

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
cff-version: "1.0.3"
44
message: "If you use this software, please cite it using these metadata."
55
title: RAFCON
6-
version: 0.15
6+
version: 2.0.0 # Handled by bump2version
77
date-released: 2019-07-29
88
license: EPL-1.0
99
doi: "10.5281/zenodo.1493058"

MANIFEST.in

-2
This file was deleted.

Makefile

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all docs build clean help
1+
.PHONY: all docs build clean version_test help
22

33

44
all: docs
@@ -14,15 +14,27 @@ docs: build
1414
python3 -m virtualenv venv --system-site-packages || return -1
1515
# Don't use the source command since not all shells support it.
1616
. venv/bin/activate;\
17-
pip3 install -r requirements.txt;\
17+
pip3 install pdm
18+
pdm export -o requirements.txt --without-hashes;\
1819
pip3 install sphinx==4.3.0 rst2pdf==0.98;\
1920
sphinx-build -v -b html doc build/docs/html
2021

2122
clean:
2223
rm -rf build
2324
rm -rf venv
2425

26+
.venv: pyproject.toml
27+
pdm install --dev --no-editable
28+
29+
version_test: .venv
30+
# Check if it is possible to bump version
31+
# e.g. all versions in files are the same and eq
32+
# to version in .bumpversion.cfg
33+
pdm run bump2version --dry-run --allow-dirty --verbose major
34+
2535
help:
2636
@echo "Available Targets:"
2737
@echo "... all"
28-
@echo "... docs"
38+
@echo "... docs"
39+
@echo "... clean"
40+
@echo "... version_test"

README.rst

+6-8
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ Collaborative working
4343
Installation preparations
4444
-------------------------
4545

46-
Before installing RAFCON, Python >=3.6, pip and setuptools are required on your system. Most of the other dependencies
46+
Before installing RAFCON, Python >=3.7, pip and setuptools are required on your system. Most of the other dependencies
4747
are automatically resolved by pip/setuptools, but not all of them. Those need be be installed manually, too:
4848

49-
Installation requirements for Ubuntu 18.04
50-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49+
Installation requirements
50+
^^^^^^^^^^^^^^^^^^^^^^^^^
5151

5252
.. code-block:: bash
5353
@@ -58,11 +58,9 @@ Installation requirements for Ubuntu 18.04
5858
General requirements
5959
^^^^^^^^^^^^^^^^^^^^
6060

61-
If you are not using Ubuntu 18.04, please make sure that the following packages are installed:
62-
63-
* Python >=3.6
64-
* pip (recent version required: v18 known to be working)
65-
* python-setuptools (recent version required: v40 known to be working)
61+
* Python >=3.7
62+
* pip (recent version required: v23 known to be working)
63+
* pdm (recent version required: v2.9.3 known to be working)
6664

6765

6866
Installing RAFCON

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.1
1+
2.0.0

conanfile.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from conans import ConanFile, CMake, tools
21
import os
32
import subprocess
4-
import arpm
3+
import sys
4+
5+
from conans import CMake, ConanFile, tools
56

67

78
def get_version():
@@ -42,6 +43,14 @@ class RafconConan(ConanFile):
4243
settings = 'os', 'compiler', 'build_type', 'arch'
4344
exports_sources = "VERSION"
4445

46+
def system_requirements(self):
47+
import pip
48+
if hasattr(pip, "main"):
49+
pip.main(["install", "pdm"])
50+
else:
51+
from pip._internal import main
52+
main(['install', "pdm"])
53+
4554
def build(self):
4655
envd = dict(os.environ)
4756
# Check if a virtual environment is active or a PYTHONPATH is set
@@ -54,15 +63,13 @@ def build(self):
5463
# print("envd: {}".format(str(envd)))
5564
# print("Package folder: {}".format(str(self.package_folder)))
5665

57-
subprocess.run(["python3", 'setup.py', 'sdist', 'bdist_wheel'], env=envd)
66+
self.run("pdm install --no-editable")
67+
self.run("pdm build")
5868

5969
print("Installing rafcon for python3")
6070

6171
rafcon_target = './dist/rafcon-{}.tar.gz'.format(self.version)
6272

63-
# print("Installing pip first")
64-
# subprocess.run(['python2.7', '-m', 'pip', 'install', '--user', '--upgrade', '--force', 'pip'], env=envd)
65-
6673
# --ignore-installed is required as otherwise already installed packages
6774
# would prevent pip from installing required dependencies
6875
# this is also true for the packages introduced by our local conan environment in /opt/conan/lib/python3.6/
@@ -72,8 +79,9 @@ def build(self):
7279
], env=envd, check=True)
7380

7481
def package_info(self):
75-
site_packages = os.path.join(self.package_folder, "lib", "python3.6", "site-packages")
82+
site_packages = os.path.join(self.package_folder, "lib", "python3.10", "site-packages")
7683
self.env_info.PYTHONPATH.append(site_packages)
77-
self.env_info.XDG_DATA_HOME = os.path.join(self.package_folder, "share")
84+
python_version = sys.version_info
85+
self.env_info.XDG_DATA_HOME = os.path.join(self.package_folder, "lib", f"python{python_version.major}.{python_version.minor}", "site-packages", "rafcon", "share")
7886
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
7987
self.env_info.RAFCON_ROOT_DIRECTORY = self.package_folder

doc/configuration.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ SOURCE\_EDITOR\_STYLE
316316
download different styles
317317
`here <https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes>`__.
318318
The scripts have to be downloaded to
319-
~/.local/share/gtksourceview-2.0/styles. "rafcon" is a style
319+
<rafcon package directory>/share/gtksourceview-2.0/styles. "rafcon" is a style
320320
created to fit to the design of RAFCON.
321321
322322
GAPHAS\_EDITOR\_AUTO\_FOCUS\_OF\_ROOT\_STATE

doc/development/includes/release_steps.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ institute):
5656
5757
8. Apply the version number
5858

59-
1. Update the version number in ``[project directory]/VERSION``.
60-
2. Update the ``version`` in ``[project directory]/CITATION.cff``.
59+
1. If the dev dependencies have not yet been installed via pdm, then run ``pdm install --dev --no-editable``
60+
2. Update the version number by running ``pdm run bump2version [major / minor / or patch]``
6161
3. Update the ``date-released`` in ``[project directory]/CITATION.cff``.
6262
4. Run ``cffconvert --ignore-suspect-keys --outputformat zenodo --outfile .zenodo.json`` (see `"Making software citable" <https://guide.esciencecenter.nl/citable_software/making_software_citable.html>`__, requires Python 3)
6363
5. Commit and push your changes.
@@ -92,7 +92,7 @@ institute):
9292
.. code:: bash
9393
9494
$ rm dist/*
95-
$ python3 setup.py sdist bdist_wheel
95+
$ pdm build
9696
$ twine upload dist/*
9797
9898
12. Publish to GitHub

doc/development/includes/testing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ unstable"``.
3636
$ tox -e 2.7 -- -x -m "core"
3737
$ tox -- -s -k "test__destruct"
3838
39-
Tox creates a virtualenv for each environment, based on the dependencies defined in ``setup.py`` and ``tox.ini``.
39+
Tox creates a virtualenv for each environment, based on the dependencies defined in ``pyproject.toml`` and ``tox.ini``.
4040
These are only generated on the first run of an environment. If the dependencies change, you need to tell tox to
4141
recreate the environments using the ``-r/--recreate`` option:
4242

doc/faq.rst

-8
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,6 @@ Probably RAFCON cannot find its fonts. If you installed RAFCON via pip, uninstal
479479
If you checked out RAFCON's git repo, reinstall the fonts. See the :ref:`Getting Started <install_fonts>` page for
480480
that.
481481

482-
**Alternatively:**
483-
Open a new terminal, run the following command and restart RAFCON.
484-
485-
.. code:: bash
486-
487-
$ fdir="$HOME/.local/share/fonts" && mkdir -p $fdir && find "$(dirname $(which rafcon))/../share/fonts" -type f -name "*.otf" -exec cp -t $fdir {} + && unset fdir
488-
489-
This will copy the RAFCON font files from the install location to your local user, so the RAFCON GUI can load them.
490482

491483
Known Issues
492484
""""""""""""

0 commit comments

Comments
 (0)