Commit b3cfcf33 authored by Thomas Nadovich's avatar Thomas Nadovich 🌸
Browse files

Merge branch 'feature/add-odg' into 'devel'

added objdict-generate command and updated build process to support

Closes #44 and #54

See merge request burt/software/burt-util!65
parents 8dc0ef5d 4bb182bd
Pipeline #18218 passed with stages
in 2 minutes and 51 seconds
......@@ -37,7 +37,6 @@ pyproject.toml
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
......
......@@ -6,14 +6,13 @@ stages:
build:
stage: build
script:
- python3 setup.py install
- make build
- pipenv install --dev
release-job:
stage: release-job
script:
- python3 setup.py install
- make package
- pipenv install --dev
- pipenv run make package
artifacts:
paths:
- packaging/*.deb
......
......@@ -2,6 +2,22 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [3.3.0]
- added objdict-generate as command, using objdict-generate 1.0.7
- fixed make setup to install the right python version
- changed runtime python version from 3.6. to 3.9 for better dependency support
- executable built from pyinstaller .spec file
## [3.2.0]
- startup-simulator now responds to mainboard startup requests correctly for any
sequence of requests
- default inspection binary for mainboard bumped from 3.6.1 to 6.0.4
- `-b` flag added to mainboard setup and inspection command to allow inspection
of both M0950 and M1340 mainboards
- added support for command aliases to be defined in burt-util config file
- p386 command refactored to p3, default aliases added for p386, p335, and p319
- config file version is now locked to burt-util version number
## [3.1.2]
- actually call gdb-multiarch correctly & specify arch when called (JLink only)
......
SHELL := /bin/bash
SHELL := /bin/bash
WORKSPACE_DIR=$(shell git rev-parse --show-toplevel)
VERSION=$(shell cat burt_util/version.py | grep --color=never -oh '[0-9]\+\.[0-9]\+\.[0-9]\+')
BUILD_DIR=${WORKSPACE_DIR}/build
......@@ -13,7 +13,7 @@ DEBIAN_GENERATED_FILES=$(DEBIAN_DIR)/$(NAME).install $(DEBIAN_DIR)/control
RELEASE_TYPE=dev
DEB=$(PACKAGING_DIR)/$(NAME)_$(VERSION)_amd64.deb
PROGRAM_OUTDIR= bin/Debug/
ENTRYPOINT=burt-util.py
SPEC=$(NAME).spec
EXE = $(DIST_DIR)/$(NAME)
......@@ -21,8 +21,8 @@ all: build
.PHONY: build
build: $(EXE)
$(EXE): $(ENTRYPOINT)
pyinstaller $< --onefile -n $(NAME)
$(EXE): $(SPEC)
pyinstaller $<
.PHONY: package
......@@ -90,13 +90,13 @@ setup: ~/.pyenv
python-openssl
# pipenv is the only python package that we need to install globably, all the
# other package get installed inside our virtual enviroment
sudo pip3 install importlib-resources==1.0 zipp==1.0
sudo pip3 install pipenv
# we need to manually build python3.6 with the --enable-shared flag
sudo pip3 install importlib-resources==1.0 zipp==1.0
sudo pip3 install pipenv
# we need to manually build python3.9 with the --enable-shared flag
# because otherwise pyinstaller won't be able to find the shared
# python libraries from within pipenv
# https://stackoverflow.com/questions/58548730/how-to-use-pyinstaller-with-pipenv-pyenv
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.9
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.5
# pyenv install 3.6.9
# lastly, we actually set up the pipenv enviroment
pipenv install --dev -v
......
......@@ -10,7 +10,7 @@ nose = "==1.3.7"
pyinstaller = "==4.0"
[requires]
python_version = "3.6"
python_version = "3.9"
# The Dockerfile that builds the executable installer on the build server
# has all of these packages installed by default so that they don't need to get
......@@ -18,32 +18,36 @@ python_version = "3.6"
# update the Docker image as well so it doesn't have to download the new stuff
# every time it runs a build.
[packages]
aiocoap = "==0.3"
arrow = "==0.17.0"
canmatrix = "==0.5"
canopen = "==0.5.1"
certifi = "==2018.8.24"
chardet = "==3.0.4"
click = "==6.6"
click-didyoumean = "==0.0.3"
click-spinner = "==0.1.10"
coverage = "==4.4.1"
docutils = "==0.14"
future = "==0.16.0"
idna = "==2.6"
logbook = "==1.4.0"
lxml = "==4.2.5"
msgpack-python = "==0.5.6"
py = "==1.6.0"
pycryptodome = "==3.6.6"
pyshark = "==0.4.2.9"
python-can = "==2.2.1"
python-dateutil = "==2.7.3"
python-gitlab = "==2.5.0"
requests = "==2.22.0"
semver = "==2.7.7"
six = "==1.10.0"
statistics = "==1.0.3.5"
toml = "==0.9.2"
"urllib3" = "==1.22"
wrapt = "==1.10.11"
aiocoap = ">=0.3"
arrow = "*"
canmatrix = ">=0.5"
canopen = "*"
certifi = ">=2018.8.24"
chardet = ">=3.0.4"
click = ">=6.6"
click-didyoumean = ">=0.0.3"
click-spinner = "*"
coverage = ">=4.4.1"
docutils = ">=0.14"
future = ">=0.16.0"
idna = ">=2.6"
logbook = ">=1.4.0"
lxml = "*"
msgpack-python = ">=0.5.6"
py = ">=1.6.0"
pycryptodome = ">=3.6.6"
pyshark = ">=0.4.2.9"
python-can = ">=2.2.1"
python-dateutil = ">=2.7.3"
python-gitlab = ">=2.5.0"
requests = ">=2.22.0"
semver = "*"
six = ">=1.10.0"
statistics = ">=1.0.3.5"
toml = ">=0.9.2"
"urllib3" = ">=1.22"
wrapt = ">=1.10.11"
GitPython = "*"
sh = "*"
objdict-generate = {git = 'https://git.barrett.com/burt/tools/objdict-generate.git', editable = true, ref = "dev-1.0.7"}
This diff is collapsed.
......@@ -3,7 +3,7 @@
> that allow you to easily upgrade firmware, flash a bootloader,
> connect to the firmware via CAN and CoAP, and much more.
**Build Status**: [![build status](https://git.barrett.com/burt/software/burt-util/badges/devel/build.svg)](https://git.barrett.com/burt/software/burt-util/commits/devel)
**Build Status**: [![build status](https://git.barrett.com/burt/software/burt-util/badges/devel/pipeline.svg)](https://git.barrett.com/burt/software/burt-util/commits/devel)
**Coverage Report**: [![coverage report](https://git.barrett.com/burt/software/burt-util/badges/devel/coverage.svg)](https://git.barrett.com/burt/software/burt-util/commits/devel)
**Origin of the name**: `burt` refers to the name of Barrett's stroke
......
# -*- mode: python ; coding: utf-8 -*-
import os
import importlib
# pyinstaller needs to be explicitly given a list of non-python data files. The
# list of data files is a list of tuples. Each tuple has two values, both of
# which must be strings. The first string specifies the file or files as they
# are in this system now. The second specifies the name of the folder to contain
# the files at run-time.
#
# burt-util doesn't have any data files like this, but objdict-generate does. To
# import these files, the following code was copied from Stack Overflow
# https://stackoverflow.com/questions/46474588/pyinstaller-how-to-include-data-files-from-an-external-package-that-was-install
package_imports = [['objdict_generate',
'resources',
['module_name.eds.tmpl',
'module_name.h.tmpl',
'module_name_table.md.tmpl',
'objdict_schema.yaml']
]]
d = []
for package, path, files in package_imports:
proot = os.path.dirname(importlib.import_module(package).__file__)
d.extend((os.path.join(proot, path, f), os.path.join(package, path)) for f in files)
block_cipher = None
a = Analysis(['burt-util.py'],
pathex=['.'],
binaries=[],
datas=d,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='burt-util',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )
......@@ -6,6 +6,7 @@ import sys
import os
import atexit
import toml
import objdict_generate
from ..default_config_toml import *
from ..burt_util_api import *
......@@ -156,6 +157,14 @@ def setup_cli():
permissions = obj['config'].get("permissions", PERMISSIONS_ENGINEER)
# the objdict_generate project already defines a click command, so we can grab
# that rather than defining one ourselves
objdict_generate_cli = objdict_generate.scripts.objdict_generate.cli
# however, the command is named 'cli' because it's the only command in the
# objdict_generate project, so we need to rename it
objdict_generate_cli.name = "objdict-generate"
if permissions >= PERMISSIONS_NONE:
cli.add_command(ping)
cli.add_command(reset)
......@@ -184,4 +193,5 @@ def setup_cli():
cli.add_command(download_artifacts)
cli.add_command(restore_artifacts)
cli.add_command(setup_inspection)
cli.add_command(objdict_generate_cli)
cli(obj=obj)
......@@ -120,6 +120,7 @@ location = "/opt/barrett/burt/release"
p319 = "p3"
p335 = "p3"
p386 = "p3"
odg = "objdict-generate"
""".format(__version__))
def config_get(config, *keys):
......
#!/usr/bin/env python3
__version__ = "3.2.0"
__version__ = "3.3.0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment