Skip to content

Commit

Permalink
Merge branch 'main' into add_get_defaults_from_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers authored Oct 3, 2023
2 parents 10cf968 + 33eb0d3 commit f0f8cdb
Show file tree
Hide file tree
Showing 43 changed files with 3,115 additions and 2,099 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
## For most projects, this workflow file will not need changing; you simply need
## to commit it to your repository.
##
## You may wish to alter this file to override the set of languages analyzed,
## or to provide custom queries or build logic.
##
## ******** NOTE ********
## We have attempted to detect the languages in your repository. Please check
## the `language` matrix defined below to confirm you have the correct set of
## supported CodeQL languages.
##
#name: "CodeQL"
#
#on:
# push:
# branches: [ develop ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ develop ]
# schedule:
# - cron: '45 5 * * 3'
#
#jobs:
# analyze:
# name: Analyze
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: read
# security-events: write
#
# strategy:
# fail-fast: false
# matrix:
# language: [ 'python' ]
# # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# # Learn more about CodeQL language support at https://git.io/codeql-language-support
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
#
# # Initializes the CodeQL tools for scanning.
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v1
# with:
# languages: ${{ matrix.language }}
# # If you wish to specify custom queries, you can do so here or in a config file.
# # By default, queries listed here will override any specified in a config file.
# # Prefix the list here with "+" to use these queries and those in the config file.
# # queries: ./path/to/local/query, your-org/your-repo/queries@main
#
# # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# # If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v1
#
# # ℹ️ Command-line programs to run using the OS shell.
# # 📚 https://git.io/JvXDl
#
# # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# # and modify them (or add more) to build your code if your project
# # uses a compiled language
#
# #- run: |
# # make bootstrap
# # make release
#
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v1
42 changes: 22 additions & 20 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true

Expand Down Expand Up @@ -53,8 +54,8 @@ jobs:
shell: bash
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8', '3.9' ]
platform: [ubuntu-latest, macOS-10.15, windows-latest]
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
platform: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
Expand All @@ -67,6 +68,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true

Expand Down Expand Up @@ -94,21 +96,21 @@ jobs:
run: make nbval
if: ${{ matrix.platform != 'windows-latest' }}

release:
name: Releasing to pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build
uses: abatilo/[email protected]
with:
python_version: 3.8.0
poetry_version: 1.0
working_directory: .
args: build
- name: Publish package
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
# release:
# name: Releasing to pypi
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# - name: Build
# uses: abatilo/[email protected]
# with:
# python_version: 3.8.0
# poetry_version: 1.3.2
# working_directory: .
# args: build
# - name: Publish package
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
23 changes: 15 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
---
version: 2
formats: []
build:
image: latest

python:
version: 3.6
pip_install: true
extra_requirements:
- docs
os: "ubuntu-22.04"
tools:
python: "3.11"
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with docs

formats: []
sphinx:
configuration: docs/conf.py
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Changelog
==========

3.2.0 - November 16 2021
------------------------

- update gha snok/install-poetry (#736) @dbarrosop
- Update pygments because of vulnerabilities (#732) @ubaumann
- Replace pkg_resources with importlib (#731) @ubaumann
- Fix GitHub actions MacOS arch failure (#729) @ktbyers
- Minor doc error on NORNIR_RUNNER_OPTIONS environment variable (#725) @ktbyers
- Correct configuration order preference error (#728) @ktbyers
- Update task_results.ipynb (#715) @MajesticFalcon
- fixing domain name typo (#704) @marco-minervino
- update ruamel dependency (#694) @itdependsnetworks
- fixed stubs for mypy 0.900 (#696) @dbarrosop

3.1.1 - April 26 2021
---------------------

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ARG PYTHON
FROM python:${PYTHON}-slim-stretch
FROM python:${PYTHON}-slim-bookworm

ENV PATH="/root/.poetry/bin:$PATH" \
ENV PATH="/root/.local/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
NORNIR_TESTS=1

RUN apt-get update \
&& apt-get install -yq curl git pandoc make \
&& curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& poetry config virtualenvs.create false

COPY pyproject.toml .
Expand All @@ -17,7 +17,7 @@ COPY poetry.lock .
# Dependencies change more often, so we break RUN to cache the previous layer
RUN poetry install --no-interaction

ARG NAME
ARG NAME=nornir
WORKDIR /${NAME}

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DOCKER_COMPOSE_FILE=docker-compose.yaml
DOCKER_COMPOSE=PYTHON=${PYTHON} docker-compose -f ${DOCKER_COMPOSE_FILE}
NORNIR_DIRS=nornir tests docs

PYTHON:=3.7
PYTHON:=3.10

.PHONY: docker
docker:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ What Nornir brings to the table is that it takes care of dealing with your inven
Install
=======

Please note that Nornir requires Python 3.6.2 or higher. Install Nornir with pip.
Please note that Nornir requires Python 3.7 or higher. Install Nornir with pip.

```
pip install nornir
Expand All @@ -39,7 +39,7 @@ If you want to clone the repo and install it from there you will need to use [po
Documentation
=============

Read the [Nornir documentation](https://nornir.readthedocs.io/) online or review it's [code here](https://github.com/nornir-automation/nornir/tree/develop/docs)
Read the [Nornir documentation](https://nornir.readthedocs.io/) online or review its [code here](https://github.com/nornir-automation/nornir/tree/develop/docs)

Examples
========
Expand Down
10 changes: 10 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Security Policy

## Supported Versions

Only latest version is supported.

## Reporting a Vulnerability

To report a vulnerability feel free to reach out on [slack](https://github.com/nornir-automation/nornir#contact--support) so we can fix before a public disclosure.
If the issue is on a dependency feel free to open a PR bumping such depdency without contacting us first.
1 change: 1 addition & 0 deletions docs/_images/Nornir3_Plugins_v0.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2022-05-23T10:06:55.813Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.3.9 Chrome/83.0.4103.119 Electron/9.0.5 Safari/537.36" etag="JW5QLFOkV7FbO5AIkN8e" version="13.3.9" type="device"><diagram id="1RKNiAfXPDfAQ1DdleVT" name="Page-1">7Vtdd5s4EP01eQxHID4fbcdum20Sb5zdNn3Zg0Gx2WBEBU7s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Nx0zIccyEmLA+caZD55WnQaSUeZNZEFtr1CnveRbENHTFsNrrFK2LOsU02JsTZZ2iNm5S4WL3xYmUd+I0yOLyQtz9/54jjGlqzWUWWtJKNKOvGCN980qiD3QcFf1mWxbxAkcuhbu0Nvy5u+YrzvfFUuPfKE233MvuOsV10KkTyfZ79eA2ExKjONzpRna0lUBnitCVJVNC2Z4WIodjFBW2ScC8w1suZRBT2uYWfl59riDte5ktH3H7hAs8U7hepki0V+62ckEW8JN2wbKLXaDFEhBfeduxKm/xV/XiPpjiH3P8G0I3U3T/7cGbjYDkhb9iz/BusycYEI+NZi9dE3S8UtLydpHeVekurLhIXgSAsk1Cv6AZ9HD3JmiO9e51Wjj+Fw==</diagram></mxfile>
Binary file added docs/_images/Nornir3_Plugins_v0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions docs/api/nornir/core/connections.rst

This file was deleted.

6 changes: 6 additions & 0 deletions docs/api/nornir/core/plugins/connections.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nornir.core.plugins.connections
=========================================

.. automodule:: nornir.core.plugins.connections
:members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/howto/ipdb_how_to_inspect_complex_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ipdb: How to inspect complex structures
=======================================

Python comes with a debuger called pdb. The python debugger is very powerful and really facilitates troubleshooting code. You can find the official documentation `here <https://docs.python.org/3.6/library/pdb.html>`_. `ipdb <https://github.com/gotcha/ipdb>`_ builds on top of ipython and pdb to give users a more interactive experience.
Python comes with a debuger called pdb. The python debugger is very powerful and really facilitates troubleshooting code. You can find the official documentation `here <https://docs.python.org/3/library/pdb.html>`_. `ipdb <https://github.com/gotcha/ipdb>`_ builds on top of ipython and pdb to give users a more interactive experience.

This how to isn't very extensive, it's just a very quick and dirty demo to show some of it's capabilities and how to use it with nornir. It doesn't assume previous knowledge but doesn't spend too much on explanations either so it expects users to give enough material for further investigation.

Expand Down
2 changes: 1 addition & 1 deletion docs/howto/ipdb_how_to_use_it_with_nornir.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ipdb: How to use it with Nornir
===============================

Python comes with a debuger called pdb. The python debugger is very powerful and really facilitates troubleshooting code. You can find the official documentation `here <https://docs.python.org/3.6/library/pdb.html>`_. `ipdb <https://github.com/gotcha/ipdb>`_ builds on top of ipython and pdb to give users a more interactive experience.
Python comes with a debuger called pdb. The python debugger is very powerful and really facilitates troubleshooting code. You can find the official documentation `here <https://docs.python.org/3/library/pdb.html>`_. `ipdb <https://github.com/gotcha/ipdb>`_ builds on top of ipython and pdb to give users a more interactive experience.

This how to isn't very extensive, it's just a very quick and dirty demo to show some of it's capabilities and how to use it with nornir. It doesn't assume previous knowledge but doesn't spend too much on explanations either so it expects users to give enough material for further investigation.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ as the Flask of automation. Nornir will take care of dealing with the inventory
have your host information, it will take care of dispatching the tasks to your devices and
will provide a common framework to write "plugins".

Nornir requires Python 3.6.2 or higher to be installed.
Nornir requires Python 3.7 or higher to be installed.

How the documentation is structured
===================================
Expand Down
9 changes: 9 additions & 0 deletions docs/nbval_sanitize.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ replace: \n
[regex2]
regex: File ".*task.py".
replace: File "nornir/nornir/core/task.py"

[regex3]
regex: File "[\w\d/]*.py", line
replace: File "/tmp/ipykernel_random.py", line

# Py3.11 adds "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" to the traceback output
[regex4]
regex: \n\s*\^*\n
replace: \n
2 changes: 2 additions & 0 deletions docs/plugins/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Plugins

Nornir is a pluggable system and only very basic ones are included with nornir 3, for a list of third party plugins visit `nornir.tech <https://nornir.tech/nornir/plugins>`_

.. image:: ../_images/Nornir3_Plugins_v0.jpg

Registering plugins
-------------------

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial/failed_tasks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"\u001b[0mTraceback (most recent call last):\n",
" File \"/nornir/core/task.py\", line 99, in start\n",
" r = self.task(self, **self.params)\n",
" File \"<ipython-input-1-3ab8433d31a3>\", line 20, in say\n",
" File \"/tmp/ipykernel_8235/676894166.py\", line 20, in say\n",
" raise Exception(\"I can't say anything right now\")\n",
"Exception: I can't say anything right now\n",
"\u001b[0m\n",
Expand Down Expand Up @@ -481,7 +481,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -495,7 +495,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit f0f8cdb

Please sign in to comment.