Skip to content

Commit

Permalink
Merge pull request #23 from IRNAS/release/v0.2.0
Browse files Browse the repository at this point in the history
Release v0.2.0
  • Loading branch information
MarkoSagadin authored Oct 3, 2022
2 parents 3329b99 + 1658a0d commit 7fac4c0
Show file tree
Hide file tree
Showing 21 changed files with 1,068 additions and 193 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-new-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: "pip"

- name: Build binary wheel and a source tarball
run: |
Expand Down
25 changes: 22 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.1.42] - 2022-09-20
## [0.2.0] - 2022-10-03

### Added

- _sys-setup_ command which will install system-wide dependencies to the host
machine.
- Global _--echo_ flag which echoes every shell command before executing it.
- _update toolchain_ command - Command will download and install appropriate
version of toolchain based on the detected NCS version. If NCS version is
currently not supported it throws an error.

### Changed
- Structure of the commands. Commands are now split into two groups: workspace
commands and system commands. This is reflected in the project directory
structure and help texts.
- Workspace commands will now use downloaded toolchain whenever they can.


## [0.1.42] - 2022-09-20

### Added

Expand All @@ -21,6 +38,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Docker scripts for building and running docker containers, for development
purposes.

[Unreleased]: https://github.com/IRNAS/irnas-east-software/compare/v0.1.42...HEAD
[Unreleased]: https://github.com/IRNAS/irnas-east-software/compare/v0.2.0...HEAD

[0.2.0]: https://github.com/IRNAS/irnas-east-software/compare/v0.1.42...v0.2.0

[0.1.42]: https://github.com/IRNAS/irnas-east-software/compare/5a4f734ca077a91cc2c77b42080f0c9814a489ed...v0.1.42
[0.1.42]: https://github.com/IRNAS/irnas-east-software/compare/5a4f734ca077a91cc2c77b42080f0c9814a489ed...v0.1.42
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install East.

```bash
pip install east-tool
pip install --upgrade east-tool
```

## Developing
## Usage

For development and testing the use of `virtualenv` is suggested.
`east` intends to be fully documented inside the tool itself, so deduplication
of documentation is avoided. Executing `east` or `east --help` in the command
line should give you sufficient information on how to use the tool.

## Developing East

For development and testing of `east` the use of `virtualenv` is suggested.

Install `virtualenv`:
```bash
Expand Down
7 changes: 5 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
install:
@pip install --editable .

install-dev:
@pip install --editable ".[dev]"

build:
@python -m build
@python3 -m build

upload-test:
@twine upload -r testpypi dist/*
Expand All @@ -12,4 +15,4 @@ upload:

version:
@echo "Next version will be:"
@python -m setuptools_scm
@python3 -m setuptools_scm
18 changes: 6 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,25 @@ enabled = true
name = "east-tool"
description="Tool built on top of West for managing nRF Connect SDK projects."
readme = "README.md"
dynamic = ["version"]
dynamic = ["version", "dependencies", "optional-dependencies"]
authors = [{ name = "Marko Sagadin", email = "[email protected]" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
dependencies = [
"rich >= 12.5.1",
"click >= 8.1.3",
"rich_click >= 1.5.2",
"requests >= 2.28.1",
]
requires-python = ">=3.8"

[project.optional-dependencies]
dev = ["black", "flake8", "pytest", "build", "twine", "setuptools_scm"]

[project.urls]
Homepage = "https://github.com/IRNAS/irnas-easttool-software"
Homepage = "https://github.com/IRNAS/irnas-east-software"

[project.scripts]
east = "east.__main__:main"

[tool.setuptools.dynamic]
dependencies = {file = ["scripts/requirements.txt"]}
optional-dependencies.dev = {file = ["scripts/requirements-dev.txt"]}

[tool.setuptools_scm]
version_scheme = "post-release"
# Can be empty, just having section will enable scm
Expand Down
27 changes: 20 additions & 7 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@ ARG WGET_ARGS="-q --show-progress --progress=bar:force:noscroll"

RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y --no-install-recommends git python3-dev python3-pip \
apt-get install -y --no-install-recommends wget make git python3-dev python3-pip \
python3-setuptools python3-wheel python3.8-venv && \
apt-get -y clean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/*

RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir rich==12.5.1 && \
pip3 install --no-cache-dir click==8.1.3 && \
pip3 install --no-cache-dir rich_click==1.5.2 && \
pip3 install --no-cache-dir requests==2.28.1

WORKDIR /home/project
ARG USER host_uid
RUN useradd -l -m -s /bin/bash -u "$host_uid" $USER

# Add to path so pip does complain later
ENV PATH="${PATH}:/home/$USER/.local/bin"
ENV USER="$USER"

WORKDIR /home
COPY requirements.txt /home
COPY requirements-dev.txt /home

# pip 22.2.2. supports editable installs for pyproject.toml
RUN pip install --no-cache-dir pip==22.2.2 && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir -r requirements-dev.txt

USER $USER

WORKDIR /home/$USER/project
23 changes: 23 additions & 0 deletions scripts/Dockerfile_after_sys_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM east-empty

ARG CONDA_LINK="https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh"
ARG WGET_ARGS="-q --show-progress --progress=bar:force:noscroll --no-check-certificate"
ARG CONDA_PATH="/home/$USER/miniconda3/bin/conda"
ARG NRF_TOOLCHAIN_LINK="https://github.com/NordicSemiconductor/pc-nrfconnect-toolchain-manager/blob/2f24ef572b8a7182cb6838fc2f080ad1b4fee448/resources/nrfutil-toolchain-manager/linux/nrfutil-toolchain-manager.exe?raw=true"
ARG EAST_DIR="/home/$USER/.local/share/east"

RUN mkdir -p $EAST_DIR

USER root
RUN wget ${WGET_ARGS} ${CONDA_LINK} -O miniconda.sh && \
wget ${WGET_ARGS} ${NRF_TOOLCHAIN_LINK} && \
mv -f nrfutil-toolchain-manager.exe?raw=true $EAST_DIR/nrfutil-toolchain-manager.exe && \
chmod +x $EAST_DIR/nrfutil-toolchain-manager.exe

USER $USER
RUN bash miniconda.sh -b && \
${CONDA_PATH} config --set auto_activate_base false && \
${CONDA_PATH} init

RUN $EAST_DIR/nrfutil-toolchain-manager.exe config --install-dir $EAST_DIR && \
$EAST_DIR/nrfutil-toolchain-manager.exe install v2.0.0
11 changes: 10 additions & 1 deletion scripts/docker_build
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/usr/bin/env bash

docker build --tag east-tool .
# docker build --tag east-empty \
# --build-arg "USER=$(whoami)" \
# --build-arg "host_uid=$(id -u)" \
# .

docker build --tag east-after-sys-setup \
--build-arg "USER=$(whoami)" \
--build-arg "host_uid=$(id -u)" \
-f Dockerfile_after_sys_setup \
.
6 changes: 0 additions & 6 deletions scripts/docker_prep

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/docker_run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run -it --volume $(pwd)/../:/home/project east-tool
docker run -it --volume $(pwd)/../:/home/$USER/project east-after-sys-setup
6 changes: 6 additions & 0 deletions scripts/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
black == 22.8.0
flake8 == 5.0.4
pytest == 7.1.3
build == 0.8.0
twine == 4.0.1
setuptools_scm == 7.0.5
5 changes: 5 additions & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rich == 12.5.1
click == 8.1.3
rich_click == 1.5.2
requests == 2.28.1
PyYAML == 6.0
Loading

0 comments on commit 7fac4c0

Please sign in to comment.