Skip to content

Commit

Permalink
Merging 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidban77 committed Oct 28, 2020
2 parents 9e0ba6d + de41dea commit d8f8737
Show file tree
Hide file tree
Showing 14 changed files with 971 additions and 845 deletions.
116 changes: 91 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
version: 2.1
workflows:
main:
jobs:
- build:
filters:
branches:
ignore:
- "gh-pages"


orbs:
codecov: codecov/codecov@1.0.5
codecov: codecov/codecov@1.1.1

jobs:
commands:
build:
docker:
# - image: circleci/python:3.7
- image: continuumio/miniconda3
parameters:
python_env:
type: string
default: py38
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib
- restore_cache:
keys:
# - deps-{{ checksum "poetry.lock" }}
- deps-clear
- deps-{{ .Branch }}-<< parameters.python_env >>-{{ checksum "poetry.lock" }}
# - deps-clear
- run:
name: Install Poetry
command: |
Expand All @@ -32,6 +26,16 @@ jobs:
name: Install Dependencies
command: |
poetry install --no-interaction
- save_cache:
key: deps-{{ .Branch }}-<< parameters.python_env >>-{{ checksum "poetry.lock" }}
# key: deps-clear
paths:
- "~/.cache/pypoetry/virtualenvs"
- "/usr/local/bin"
- "/usr/local/lib"

linting:
steps:
- run:
name: Run flake8
command: |
Expand All @@ -40,19 +44,81 @@ jobs:
name: Run black formatting check
command: |
poetry run black --diff --check .
test:
steps:
- run:
name: Run tox
name: Running tests
command: |
poetry run tox
- save_cache:
# key: deps-{{ checksum "poetry.lock" }}
key: deps-clear
paths:
- /root/.cache/pypoetry/virtualenvs
- /root/.cache/.tox
poetry run pytest tests/ -v
executors:
py36-executor:
docker:
- image: circleci/python:3.6
py37-executor:
docker:
- image: circleci/python:3.7
py38-executor:
docker:
- image: circleci/python:3.8

jobs:
test-with-py36:
executor: py36-executor
steps:
- build:
python_env: py36
- linting
- test
test-with-py37:
executor: py37-executor
steps:
- build:
python_env: py37
- linting
- test
test-with-py38:
executor: py38-executor
steps:
- build:
python_env: py38
- linting
- test

coverage_publish:
executor: py38-executor
steps:
- build
- run:
name: Running tests
name: Running tests with coverage
command: |
poetry run pytest --cov-report=xml --cov=gns3fy tests/
- codecov/upload:
file: coverage.xml

workflows:
py36-test:
jobs:
- test-with-py36:
filters:
branches:
ignore:
- "gh-pages"
py37-test:
jobs:
- test-with-py37:
filters:
branches:
ignore:
- "gh-pages"
py38-test:
jobs:
- test-with-py38:
filters:
branches:
ignore:
- "gh-pages"
- coverage_publish:
requires:
- "test-with-py38"
26 changes: 14 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Inspired from:
# https://github.com/nornir-automation/nornir/blob/develop/Dockerfile
# https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3-miniconda
FROM continuumio/miniconda3
# FROM continuumio/miniconda3
FROM circleci/python:3.7

WORKDIR /gns3fy
ENV PATH="/root/.poetry/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive
USER circleci:circleci
# ENV PATH="/root/.poetry/bin:$PATH" \
# PYTHONDONTWRITEBYTECODE=1 \
# PYTHONUNBUFFERED=1 \
# DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -yq curl git openssh-client less iproute2 procps iproute2 lsb-release make \
&& curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python \
&& poetry config virtualenvs.create false \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# RUN apt-get update \
# && apt-get install -yq curl git openssh-client less iproute2 procps iproute2 lsb-release make \
# && curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python \
# && poetry config virtualenvs.create false \
# && apt-get autoremove -y \
# && apt-get clean -y \
# && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml .
COPY poetry.lock .
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Needs to be on master branch
docs-publish:
cd docs; mkdocs gh-deploy -m "[ci skip]"
mkdocs gh-deploy -m "[ci skip]" --force

docs-generate:
cd docs; pydoc-markdown > content/api_reference.md
pydoc-markdown docs/pydoc-markdown.yml > docs/content/api_reference.md

docs-show:
cd docs; mkdocs serve
mkdocs serve

test:
poetry run flake8 .
poetry run black --diff --check .
poetry run tox
poetry run pytest --cov-report=xml --cov=gns3fy tests/
poetry run pytest --cov-report=html --cov=gns3fy tests/

build:
poetry build
Expand Down
10 changes: 10 additions & 0 deletions docs/content/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ pip install -U gns3fy

## Releases

### 0.7.1

**Enhancement:**

- Refactored docs for `mkdocs-material` theme
- Improved CircleCI pipeline config to use workflows, parameters and reusable commands
- Changed CI image from `miniconda3` to `circleci`. It has latest `poetry` and `curl` installed, which is needed for testing and publishing coverage.
- Added labels to `create_link` method. [PR-78](https://github.com/davidban77/gns3fy/pull/78)
- Testing is done on a per-python interpreter basis, meaning that `tox` is no longer needed.

### 0.7.0

**Enhancement:**
Expand Down
Loading

0 comments on commit d8f8737

Please sign in to comment.