Skip to content

Commit

Permalink
Merge pull request #875 from DLR-RM/develop
Browse files Browse the repository at this point in the history
Updates from AgileRobotsAG to version 2.0.0
  • Loading branch information
flolay authored Jan 29, 2024
2 parents 608c481 + 0bffdd0 commit 22d8b3b
Show file tree
Hide file tree
Showing 730 changed files with 13,097 additions and 8,245 deletions.
14 changes: 14 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[bumpversion]
current_version = 2.0.0

[bumpversion:glob:**/pyproject.toml]
search = version = "{current_version}" # Handled by bump2version
replace = version = "{new_version}" # Handled by bump2version

[bumpversion:file:VERSION]
search = {current_version}
replace = {new_version}

[bumpversion:file:CITATION.cff]
search = version: {current_version} # Handled by bump2version
replace = version: {new_version} # Handled by bump2version
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,10 @@ dart-sass
dart-sass*
*.css.map

# pdm tool
.pdm-python
# ignore requirements as this is this only needed for make docs and is then generated by pdm
requirements.txt

# do not ignore bump2version config
!.bumpversion.cfg
68 changes: 55 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include:
ref: 'release/3.x'
file:
- '/ci/templates/default.yml'
- '/ci/templates/python/default.yml'

variables:
AR_CI_CLANG_FORMAT_DISABLE: "true"
Expand All @@ -30,12 +31,14 @@ variables:

docs_test:
extends: .docs_test
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
variables:
BUILD_DIR: build
CONAN_OPTIONS: ""
MAKE_CMD_DOCS: "make docs"

pages:
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
extends: .docs_pages
variables:
BUILD_DIR: build
Expand All @@ -52,11 +55,12 @@ pages:
test py3-tests: &test-py3-tests
<<: *only-default
stage: Test
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
tags:
- Agile_GUI_Docker
script:
- pip3 install tox
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e py36
- pip3 install tox pdm
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e py310
coverage: /^TOTAL.+?(\d+\%)$/
artifacts:
expire_in: 7 days
Expand All @@ -68,10 +72,11 @@ test py3-tests: &test-py3-tests
test py3-tests-core:
<<: *only-default
stage: Test
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
tags:
- Agile_GUI_Docker
script:
- pip3 install tox
- pip3 install tox pdm
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e core
coverage: /^TOTAL.+?(\d+\%)$/
artifacts:
Expand All @@ -84,23 +89,60 @@ test py3-tests-core:
test py3-memory-test-core:
<<: *only-default
stage: Test
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
tags:
- Agile_GUI_Docker
script:
- pip3 install tox
- pip3 install tox pdm
- pdm install --dev --no-editable
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e memory_core
artifacts:
expire_in: 7 days
expire_in: 7 days

Pip::build pure:
variables:
AR_PYTHON_PACKAGE_WHEEL_DIR: "${CI_PROJECT_DIR}/wheels"
before_script:
- python3 -m pip install -U pip
- export AR_PYTHON_PACKAGE_ROOT_DIR="${CI_PROJECT_DIR}/${AR_PYTHON_PACKAGE_ROOT_DIR_SUFFIX}"
parallel:
matrix:
- AR_PYTHON_PACKAGE_ROOT_DIR_SUFFIX: [".", "source"]

# running pytest directly does not work
# as the test_start_script.py test_start_script_valid_config always uses "python" to start "rafcon_core"
# which fails if tests are run using python3 as the "python" always maps to python2 on Ubuntu 18.04
# - xvfb-run -as "-screen 0 1920x1200x24" python3 setup.py pytest --addopts '-vx -m "(core or guqi) and not unstable and not user_input"'
Test Rafcon Core Python Wheel:
stage: Test
<<: *only-default
needs: [ "Pip::build pure" ]
dependencies: [ "Pip::build pure" ]
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
script:
- python3 -m pip install -U pip pytest pytest-timeout
- python3 -m pip install wheels/rafcon_core*.whl
- python3 -m pytest tests/core

Pip::test on Linux:
before_script:
# These apt packages are needed by the rafcon pip package for installation
- apt update && apt install -y libcairo2 libcairo2-dev build-essential libgirepository1.0-dev
parallel:
matrix:
- PYTHON_IMAGE:
- artifactory.ar.int:5000/ar-python-slim:3.7.16
- artifactory.ar.int:5000/ar-python-slim:3.8.16
- artifactory.ar.int:5000/ar-python-slim:3.9.16
- artifactory.ar.int:5000/ar-python-slim:3.10.10

Test Python Upcoming:
<<: *test-py3-tests
Pip::test on Windows:
rules:
- when: never

Version Test:
<<: *only-default
stage: Test
image: artifactory.ar.int:5000/ar-ci-ubuntu:22.04
script:
- pip3 install tox
- xvfb-run -as "-screen 0 1920x1200x24" tox -r -c tox_external.ini -e py310
# Check if it is possible to bump version
# e.g. all versions in files are the same and eq
# to version in .bumpversion.cfg
- pip install pdm
- make version_test
14 changes: 13 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ details can be found in the `GIT commit log <https://github.com/DLR-RM/RAFCON/co
Future Release
"""""""

2.0.0
""""""
- Features:
- Switch from setup.py to pyproject.toml and pdm for the python package management
- Add bump2version to avoid human errors when updating the rafcon version
- Added auto-layout functionality (as a first version)

1.3.0
"""""""
- Features:
Add possibility to only release rafcon-core

1.2.1
"""""""
- Features:
Expand Down Expand Up @@ -1726,4 +1738,4 @@ Patch releases 0.2.\*
"""""

- First release version
- Tool was renamed to RAFCON
- Tool was renamed to RAFCON
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cff-version: "1.0.3"
message: "If you use this software, please cite it using these metadata."
title: RAFCON
version: 0.15
version: 2.0.0 # Handled by bump2version
date-released: 2019-07-29
license: EPL-1.0
doi: "10.5281/zenodo.1493058"
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all docs build clean help
.PHONY: all docs build clean version_test help


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

clean:
rm -rf build
rm -rf venv

.venv: pyproject.toml
pdm install --dev --no-editable

version_test: .venv
# Check if it is possible to bump version
# e.g. all versions in files are the same and eq
# to version in .bumpversion.cfg
pdm run bump2version --dry-run --allow-dirty --verbose major

help:
@echo "Available Targets:"
@echo "... all"
@echo "... docs"
@echo "... docs"
@echo "... clean"
@echo "... version_test"
14 changes: 6 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Collaborative working
Installation preparations
-------------------------

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

Installation requirements for Ubuntu 18.04
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Installation requirements
^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
Expand All @@ -58,11 +58,9 @@ Installation requirements for Ubuntu 18.04
General requirements
^^^^^^^^^^^^^^^^^^^^

If you are not using Ubuntu 18.04, please make sure that the following packages are installed:

* Python >=3.6
* pip (recent version required: v18 known to be working)
* python-setuptools (recent version required: v40 known to be working)
* Python >=3.7
* pip (recent version required: v23 known to be working)
* pdm (recent version required: v2.9.3 known to be working)


Installing RAFCON
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
2.0.0
24 changes: 16 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from conans import ConanFile, CMake, tools
import os
import subprocess
import arpm
import sys

from conans import CMake, ConanFile, tools


def get_version():
Expand Down Expand Up @@ -42,6 +43,14 @@ class RafconConan(ConanFile):
settings = 'os', 'compiler', 'build_type', 'arch'
exports_sources = "VERSION"

def system_requirements(self):
import pip
if hasattr(pip, "main"):
pip.main(["install", "pdm"])
else:
from pip._internal import main
main(['install', "pdm"])

def build(self):
envd = dict(os.environ)
# Check if a virtual environment is active or a PYTHONPATH is set
Expand All @@ -54,15 +63,13 @@ def build(self):
# print("envd: {}".format(str(envd)))
# print("Package folder: {}".format(str(self.package_folder)))

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

print("Installing rafcon for python3")

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

# print("Installing pip first")
# subprocess.run(['python2.7', '-m', 'pip', 'install', '--user', '--upgrade', '--force', 'pip'], env=envd)

# --ignore-installed is required as otherwise already installed packages
# would prevent pip from installing required dependencies
# this is also true for the packages introduced by our local conan environment in /opt/conan/lib/python3.6/
Expand All @@ -72,8 +79,9 @@ def build(self):
], env=envd, check=True)

def package_info(self):
site_packages = os.path.join(self.package_folder, "lib", "python3.6", "site-packages")
site_packages = os.path.join(self.package_folder, "lib", "python3.10", "site-packages")
self.env_info.PYTHONPATH.append(site_packages)
self.env_info.XDG_DATA_HOME = os.path.join(self.package_folder, "share")
python_version = sys.version_info
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")
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
self.env_info.RAFCON_ROOT_DIRECTORY = self.package_folder
2 changes: 1 addition & 1 deletion doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ SOURCE\_EDITOR\_STYLE
download different styles
`here <https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes>`__.
The scripts have to be downloaded to
~/.local/share/gtksourceview-2.0/styles. "rafcon" is a style
<rafcon package directory>/share/gtksourceview-2.0/styles. "rafcon" is a style
created to fit to the design of RAFCON.
GAPHAS\_EDITOR\_AUTO\_FOCUS\_OF\_ROOT\_STATE
Expand Down
6 changes: 3 additions & 3 deletions doc/development/includes/release_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ institute):
8. Apply the version number

1. Update the version number in ``[project directory]/VERSION``.
2. Update the ``version`` in ``[project directory]/CITATION.cff``.
1. If the dev dependencies have not yet been installed via pdm, then run ``pdm install --dev --no-editable``
2. Update the version number by running ``pdm run bump2version [major / minor / or patch]``
3. Update the ``date-released`` in ``[project directory]/CITATION.cff``.
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)
5. Commit and push your changes.
Expand Down Expand Up @@ -92,7 +92,7 @@ institute):
.. code:: bash
$ rm dist/*
$ python3 setup.py sdist bdist_wheel
$ pdm build
$ twine upload dist/*
12. Publish to GitHub
Expand Down
2 changes: 1 addition & 1 deletion doc/development/includes/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ unstable"``.
$ tox -e 2.7 -- -x -m "core"
$ tox -- -s -k "test__destruct"
Tox creates a virtualenv for each environment, based on the dependencies defined in ``setup.py`` and ``tox.ini``.
Tox creates a virtualenv for each environment, based on the dependencies defined in ``pyproject.toml`` and ``tox.ini``.
These are only generated on the first run of an environment. If the dependencies change, you need to tell tox to
recreate the environments using the ``-r/--recreate`` option:

Expand Down
8 changes: 0 additions & 8 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,6 @@ Probably RAFCON cannot find its fonts. If you installed RAFCON via pip, uninstal
If you checked out RAFCON's git repo, reinstall the fonts. See the :ref:`Getting Started <install_fonts>` page for
that.

**Alternatively:**
Open a new terminal, run the following command and restart RAFCON.

.. code:: bash
$ fdir="$HOME/.local/share/fonts" && mkdir -p $fdir && find "$(dirname $(which rafcon))/../share/fonts" -type f -name "*.otf" -exec cp -t $fdir {} + && unset fdir
This will copy the RAFCON font files from the install location to your local user, so the RAFCON GUI can load them.

Known Issues
""""""""""""
Expand Down
Loading

0 comments on commit 22d8b3b

Please sign in to comment.