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

Commit

Permalink
Merge pull request #78 from riotkit-org/issue_77
Browse files Browse the repository at this point in the history
#77: Support for subprojects
  • Loading branch information
blackandred authored May 6, 2022
2 parents fb15759 + 3c618b5 commit d0e382c
Show file tree
Hide file tree
Showing 33 changed files with 932 additions and 205 deletions.
76 changes: 37 additions & 39 deletions .github/workflows/test-and-release-rkd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,45 @@ name: Test and release a package
on: [push]

jobs:
# test:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# python-version: ["3.8", "3.9", "3.7"]
# steps:
# - name: Set GIT identity
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "Buenaventura Durruti"
#
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Setup Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Install dependencies
# run: "make deps"
#
# - name: Build project
# run: "make package"
#
# - name: Run RKD tests on Python ${{ matrix.python-version }}
# run: "make tests"
#
# - name: Archive RKD tests results
# uses: dorny/test-reporter@v1
# if: always()
# with:
# name: "[${{ matrix.python-version }}] RKD tests"
# path: src/*/build/tests.xml
# reporter: java-junit
#
# - name: Run rkd_python tests on Python ${{ matrix.python-version }}
# run: "cd subpackages/rkd_python && make tests"
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.7"]
max-parallel: 2
steps:
- name: Set GIT identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "Buenaventura Durruti"
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: "make deps"

- name: Build project
run: "make package"

- name: Run RKD tests on Python ${{ matrix.python-version }}
run: "make tests"

- name: Archive RKD tests results
uses: dorny/test-reporter@v1
if: always()
with:
name: "[${{ matrix.python-version }}] RKD tests"
path: src/*/build/tests.xml
reporter: java-junit

release:
# needs: [test]
needs: [test]
runs-on: ubuntu-20.04
if: always()
steps:
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
SHELL=/bin/bash
TEST_OPTS=
TESTS_ARGS=

## Installs dependencies for all packages
deps:
Expand All @@ -16,13 +17,16 @@ deps:
## Run tests
tests:
set +e; \
export RKD_BIN="python -m rkd.core" PYTHONPATH="$$(pwd)/src/core:$$(pwd)/src/process:$$(pwd)/src/pythonic"; \
\
BASE_PATH=$$(pwd); \
for package_directory in $$(ls ./src); do \
if [[ ! -d $$BASE_PATH/src/$$package_directory/tests ]]; then \
continue; \
fi; \
echo ">> $${package_directory}"; \
mkdir -p $$BASE_PATH/src/$$package_directory/build; \
set -x; \
cd "$$BASE_PATH/src/$$package_directory"; pytest ./tests --junitxml=build/tests.xml;\
cd "$$BASE_PATH/src/$$package_directory"; pytest --junitxml=build/tests.xml ${TESTS_ARGS};\
done

## Release
Expand Down
2 changes: 2 additions & 0 deletions src/core/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ setuptools-scm = "*"
[dev-packages]
pytest = "*"
psutil = "*"
importlib-metadata = {version = ">=0.12", markers = "python_version<'3.8'"}

[pipenv]
name = "rkd.core"
allow_prereleases = true
84 changes: 71 additions & 13 deletions src/core/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/core/rkd/core/api/inputoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def finish(self) -> 'Wizard':


def clear_formatting(text: str) -> str:
text = re.sub("\\x1B\[([0-9]+)m", '', text)
text = re.sub('\x1B\\[([0-9]+)m', '', text)

return text

Expand Down Expand Up @@ -649,7 +649,7 @@ def get_environment_copy() -> dict:

return dict(
map(
lambda kv: (kv[0], str(kv[1]).replace('$', '\$')),
lambda kv: (kv[0], str(kv[1]).replace('$', '\\$')),
dict(deepcopy(os.environ)).items()
)
)
Loading

0 comments on commit d0e382c

Please sign in to comment.