Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

[scons] Python 3 support for SConscripts and related tools #297

Merged
merged 10 commits into from
Jan 3, 2018
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,34 @@ jobs:
command: |
scons check=devices

"scripts-python2.7":
docker:
- image: roboterclubaachen/xpcc-build:latest
environment:
- SCONS_LIB_DIR: "/usr/local/lib/python2.7/dist-packages/scons-2.5.1"
- SCONSFLAGS: "-j3"
steps:
- checkout
- run:
name: Check if tool scripts run with Python2
command: |
python2 tools/authors.py --handles --count --shoutout --since 2017-01-01
python2 tools/system_design/builder/system_layout.py examples/communication/xml/communication.xml -o /tmp

"scripts-python3":
docker:
- image: roboterclubaachen/xpcc-build:latest
environment:
- SCONS_LIB_DIR: "/usr/local/lib/python2.7/dist-packages/scons-2.5.1"
- SCONSFLAGS: "-j3"
steps:
- checkout
- run:
name: Check if tool scripts run with Python3
command: |
python3 tools/authors.py --handles --count --shoutout --since 2017-01-01
python3 tools/system_design/builder/system_layout.py examples/communication/xml/communication.xml -o /tmp

workflows:
version: 2
build:
Expand All @@ -229,3 +257,5 @@ workflows:
- "generic-examples"
- "linux-examples"
- "avr-examples"
- "scripts-python2.7"
- "scripts-python3"
17 changes: 16 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ addons:
- libgtkmm-2.4-dev
- g++-7
- libzmqpp-dev
- texlive-latex-base
- texlive-fonts-recommended

before_install:
- export CC=gcc-7
Expand All @@ -36,8 +38,11 @@ before_install:
- which arm-none-eabi-g++
- arm-none-eabi-g++ --version
- pip install --upgrade pip wheel
- pip install jinja2 lxml
- pip install jinja2 lxml numpy
- pip install scons==2.5.1
- pip install pyx==0.12.1
- pip3 install wheel
- pip3 install jinja2 lxml numpy scons pyx

cache:
directories:
Expand All @@ -57,3 +62,13 @@ env:
- TEST_SUITE="unittest target=atmega"

script: "scons $TEST_SUITE"

jobs:
include:
- stage: deploy
script:
- "python2 tools/authors.py --handles --count --shoutout --since 2017-01-01"
- "python3 tools/authors.py --handles --count --shoutout --since 2017-01-01"
- "python2 tools/system_design/builder/system_layout.py examples/communication/xml/communication.xml -o /tmp"
- "python3 tools/system_design/builder/system_layout.py examples/communication/xml/communication.xml -o /tmp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be duplicated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, as the commit message says, we want to test all scripts with Python 2 and Python 3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn’t see the difference there 🤦‍♂️

env: TEST_SUITE=""
6 changes: 3 additions & 3 deletions tools/authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def get_author_log(since = None, until = None, handles = True, count = False):
for (commits, author) in commit_tuples:
out = author
if handles and author in author_handles and author_handles[author] is not None:
out += " (@{})".format(author_handles[author])
out += u" (@{})".format(author_handles[author])
if count:
out = "{:4} {}".format(commits, out)
out = u"{:4} {}".format(commits, out)
output.append(out)
return output

Expand Down Expand Up @@ -98,6 +98,6 @@ def get_author_log(since = None, until = None, handles = True, count = False):
authors = []
for author in log_authors:
if any(a in author for a in new_authors):
author += " 🎉🎊"
author += "" # " 🎉🎊"
authors.append(author)
print("\n".join(authors))
56 changes: 0 additions & 56 deletions tools/bitmap/pbm2c.py

This file was deleted.