Skip to content

Commit 50aba97

Browse files
authored
Merge pull request #1 from saltstack/develop
Merge saltstack/pepper to ArcaniteSolutions/pepper
2 parents 7413e54 + 996fc29 commit 50aba97

45 files changed

Lines changed: 1610 additions & 1164 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/flake8.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: flake8 lint
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
flake8-lint:
8+
runs-on: ubuntu-24.04
9+
name: flake8 lint
10+
steps:
11+
- name: Setup python for flake8
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: "3.10"
15+
- uses: actions/checkout@v3
16+
- name: Install nox
17+
run: python -m pip install nox==2024.10.09
18+
- name: Setup flake8
19+
run: nox --force-color -e flake8 --install-only
20+
- name: Run flake8
21+
run: nox --force-color -e flake8 -vv

.github/workflows/test.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: test
2+
on:
3+
workflow_dispatch:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 8 * * *"
8+
9+
jobs:
10+
pre-commit:
11+
name: pre-commit
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.10"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pre-commit
24+
pre-commit install
25+
- name: Run pre-commit
26+
run: pre-commit run --all-files
27+
28+
test:
29+
name: test ${{ matrix.py }} - ${{ matrix.netapi }} - ${{ matrix.salt }}
30+
runs-on: ubuntu-22.04
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
py:
35+
- "3.8"
36+
- "3.9"
37+
- "3.10"
38+
- "3.11"
39+
netapi:
40+
- "cherrypy"
41+
- "tornado"
42+
salt:
43+
- "v3006.9"
44+
- "v3007.1"
45+
- "master"
46+
exclude:
47+
- py: "3.8"
48+
salt: "v3007.1"
49+
- py: "3.9"
50+
salt: "v3007.1"
51+
- py: "3.8"
52+
salt: "master"
53+
- py: "3.9"
54+
salt: "master"
55+
env:
56+
SALT_REQUIREMENT: ${{ matrix.salt == 'master' && 'salt@git+https://github.com/saltstack/salt.git@master' || format('salt=={0}', matrix.salt) }}
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Set up Python ${{ matrix.py }}
60+
uses: actions/setup-python@v4
61+
with:
62+
python-version: ${{ matrix.py }}
63+
64+
- name: Install setuptools_scm
65+
run: python -m pip install setuptools_scm
66+
67+
- name: Install dependencies
68+
run: sudo apt update && sudo apt install -y libc6-dev libffi-dev gcc git openssh-server libzmq3-dev
69+
env:
70+
DEBIAN_FRONTEND: noninteractive
71+
72+
- name: Install Nox
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install nox
76+
77+
- name: Install Test Requirements
78+
env:
79+
PYTHON_VERSIONS: ${{ matrix.py }}
80+
API_BACKEND: ${{ matrix.netapi }}
81+
run: |
82+
nox --force-color -e tests --install-only
83+
84+
- name: Test
85+
env:
86+
PYTHON_VERSIONS: ${{ matrix.py }}
87+
API_BACKEND: ${{ matrix.netapi }}
88+
SKIP_REQUIREMENTS_INSTALL: YES
89+
run: |
90+
nox --force-color -e tests -- -vv tests/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
MANIFEST
77
dist/
88
salt_pepper.egg-info/
9-
.tox/
9+
.nox/
10+
artifacts/

.pre-commit-config.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
minimum_pre_commit_version: 3.5.0
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: check-merge-conflict # Check for files that contain merge conflict strings.
8+
- id: trailing-whitespace # Trims trailing whitespace.
9+
args: [--markdown-linebreak-ext=md]
10+
- id: mixed-line-ending # Replaces or checks mixed line ending.
11+
args: [--fix=lf]
12+
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
13+
- id: check-merge-conflict # Check for files that contain merge conflict strings.
14+
- id: check-ast # Simply check whether files parse as valid python.
15+
16+
# ----- Formatting ---------------------------------------------------------------------------->
17+
- repo: https://github.com/myint/autoflake
18+
rev: v2.2.1
19+
hooks:
20+
- id: autoflake
21+
name: Remove unused variables and imports
22+
language: python
23+
args: ["--in-place", "--remove-all-unused-imports", "--remove-unused-variables", "--expand-star-imports"]
24+
files: \.py$
25+
26+
- repo: https://github.com/saltstack/pre-commit-remove-import-headers
27+
rev: 1.1.0
28+
hooks:
29+
- id: remove-import-headers
30+
31+
- repo: https://github.com/saltstack/salt-rewrite
32+
# Automatically rewrite code with known rules
33+
rev: 2.5.2
34+
hooks:
35+
- id: salt-rewrite
36+
alias: rewrite-tests
37+
name: Rewrite the test suite
38+
files: ^tests/.*\.py$
39+
args: [--silent, -E, fix_docstrings]
40+
41+
- repo: https://github.com/asottile/pyupgrade
42+
rev: v3.15.0
43+
hooks:
44+
- id: pyupgrade
45+
name: Rewrite Code to be Py3+
46+
args: [
47+
--py3-plus
48+
]
49+
50+
- repo: https://github.com/asottile/reorder_python_imports
51+
rev: v3.12.0
52+
hooks:
53+
- id: reorder-python-imports
54+
args: [
55+
--py3-plus,
56+
]
57+
58+
- repo: https://github.com/psf/black
59+
rev: 23.12.1
60+
hooks:
61+
- id: black
62+
args: [-l 100]
63+
64+
# <---- Formatting -----------------------------------------------------------------------------

.travis.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1+
dist: xenial
12
sudo: false
23
services:
34
- docker
45
language: python
5-
cache: pip
66
services:
77
- docker
88

9-
before_install:
10-
- pyenv versions
11-
- pyenv version-name
12-
- env
13-
149
install:
1510
- pip install tox
1611

@@ -19,21 +14,28 @@ python:
1914
- '3.4'
2015
- '3.5'
2116
- '3.6'
22-
- '3.7-dev'
17+
- '3.7'
18+
- '3.8-dev'
2319

2420
env:
25-
- SALT=-v2018.3 BACKEND=-cherrypy CODECOV=py
26-
- SALT=-v2018.3 BACKEND=-tornado CODECOV=py
27-
- SALT=-v2019.2 BACKEND=-cherrypy CODECOV=py
28-
- SALT=-v2019.2 BACKEND=-tornado CODECOV=py
21+
- SALT=v2018.3 BACKEND=cherrypy
22+
- SALT=v2018.3 BACKEND=tornado
23+
- SALT=v2019.2 BACKEND=cherrypy
24+
- SALT=v2019.2 BACKEND=tornado
25+
- SALT=develop BACKEND=cherrypy
26+
- SALT=develop BACKEND=tornado
2927

3028
matrix:
31-
env:
29+
allow_failures:
30+
- python: '3.8-dev'
31+
- env: SALT=develop BACKEND=tornado
32+
- env: SALT=develop BACKEND=cherrypy
3233

3334
script:
34-
- PYTHON="${TRAVIS_PYTHON_VERSION%-dev}"
35-
- docker run -v $PWD:/pepper -ti --rm gtmanfred/pepper:latest tox -c /pepper/tox.ini -e "${TRAVIS_PYTHON_VERSION%%.*}flake8,${CODECOV}${PYTHON//./}${BACKEND}${SALT}"
35+
- PYTHON="${TRAVIS_PYTHON_VERSION/-dev/-rc}"
36+
- TOX_VERSION="py${PYTHON//./}"
37+
- docker run -v $PWD:/pepper -ti --rm "python:$PYTHON" make -C /pepper test PYVERSION="${TOX_VERSION%-rc}" SALT="${SALT}" BACKEND="${BACKEND}"
3638

3739
after_success:
3840
- sudo chown $USER .tox/
39-
- if [[ $CODECOV == "py" ]]; then tox -e codecov; fi
41+
- tox -e codecov

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
16-

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PYVERSION?=py37
2+
SALT?=v2019.2
3+
BACKEND?=cherrypy
4+
DEBIAN_FRONTEND=noninteractive
5+
6+
install:
7+
apt update && apt install -y libc6-dev libffi-dev gcc git openssh-server libzmq3-dev
8+
pip install tox
9+
10+
test: install
11+
tox -e flake8,$(PYVERSION)-$(BACKEND)-$(SALT)

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Examples leveraging the runner client.
5959
Configuration
6060
-------------
6161

62-
You can configure pepper through the command line, using environment variables
63-
or in a configuration file ``$HOME/.pepperrc`` with the following syntax :
62+
You can configure pepper through the command line, using environment variables
63+
or in a configuration file ``$HOME/.pepperrc`` with the following syntax :
6464

65-
.. code-block::
65+
.. code-block::
6666
6767
[main]
6868
SALTAPI_URL=https://localhost:8000/

azure-pipelines.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
trigger:
2+
- develop
3+
4+
variables:
5+
python: '["py2.7", "py3.4", "py3.5", "py3.6", "py3.7", "py3.8"]'
6+
salt: '["v2018.3", "v2019.2", "develop"]'
7+
backends: '["cherrypy", "tornado"]'
8+
9+
jobs:
10+
- job: build_matrix
11+
pool:
12+
vmImage: 'Ubuntu-16.04'
13+
steps:
14+
- task: UsePythonVersion@0
15+
inputs:
16+
versionSpec: '3.7'
17+
architecture: x64
18+
19+
- task: PythonScript@0
20+
name: matrix
21+
inputs:
22+
scriptSource: Inline
23+
script: |
24+
import json
25+
matrix = {}
26+
for pyver in $(python):
27+
for saltver in $(salt):
28+
for backend in $(backends):
29+
matrix['{0}-{1}-{2}'.format(pyver, backend, saltver)] = {
30+
'python.version': pyver[2:],
31+
'version': pyver.replace('.', ''),
32+
'salt': saltver,
33+
'backend': backend,
34+
}
35+
print('##vso[task.setvariable variable=matrix;isOutput=true]{0}'.format(json.dumps(matrix)))
36+
37+
- job: test_pepper
38+
dependsOn: build_matrix
39+
pool:
40+
vmImage: 'Ubuntu-16.04'
41+
strategy:
42+
matrix: $[ dependencies.build_matrix.outputs['matrix.matrix'] ]
43+
steps:
44+
- task: UsePythonVersion@0
45+
inputs:
46+
versionSpec: '$(python.version)'
47+
architecture: x64
48+
49+
- script: |
50+
pip install tox
51+
displayName: Install dependencies
52+
- script: |
53+
docker run -v $PWD:/pepper --rm "python:$(python.version)" make -C /pepper test PYTHON_VERSION=$(version) SALT=$(salt) BACKEND=$(backend)
54+
displayName: pytest
55+
- script: |
56+
sudo chown $USER .tox/
57+
tox -e codecov
58+
displayName: codecov
59+
env:
60+
CODECOV_TOKEN: '16c2a232-4329-438c-b163-ccbfeeab47aa'

codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ comment:
2525
layout: "header, diff"
2626
behavior: default
2727
require_changes: no
28-

0 commit comments

Comments
 (0)