diff --git a/.copier-answers.yml b/.copier-answers.yml
new file mode 100644
index 0000000..0106b3c
--- /dev/null
+++ b/.copier-answers.yml
@@ -0,0 +1,21 @@
+# Autogenerated. Do not edit this by hand, use `copier update`.
+---
+_commit: 0.2.6
+_src_path: https://github.com/lkubb/salt-extension-copier
+author: EITR Technologies, LLC
+author_email: devops@eitr.tech
+docs_url: ''
+license: apache
+loaders:
+ - module
+max_salt_version: 3006
+no_saltext_namespace: false
+package_name: servicenow
+project_name: servicenow
+python_requires: '3.8'
+salt_version: '3005'
+source_url: https://github.com/salt-extensions/saltext-servicenow
+ssh_fixtures: false
+summary: Salt Extension for interacting with Servicenow
+tracker_url: https://github.com/salt-extensions/saltext-servicenow/issues
+url: https://github.com/salt-extensions/saltext-servicenow
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..879568e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,11 @@
+### Description of Issue
+
+
+### Setup
+(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
+
+### Steps to Reproduce Issue
+(Include debug logs if possible and relevant.)
+
+### Versions Report
+(Provided by running `salt --versions-report`. Please also mention any differences in master/minion versions.)
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..b232a42
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,48 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: "[BUG]"
+labels: bug, needs-triage
+assignees: ''
+
+---
+
+**Description**
+A clear and concise description of what the bug is.
+
+**Setup**
+(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
+
+Please be as specific as possible and give set-up details.
+
+- [ ] on-prem machine
+- [ ] VM (Virtualbox, KVM, etc. please specify)
+- [ ] VM running on a cloud service, please be explicit and add details
+- [ ] container (Kubernetes, Docker, containerd, etc. please specify)
+- [ ] or a combination, please be explicit
+- [ ] jails if it is FreeBSD
+- [ ] classic packaging
+- [ ] onedir packaging
+- [ ] used bootstrap to install
+
+
+**Steps to Reproduce the behavior**
+(Include debug logs if possible and relevant)
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Versions Report**
+salt --versions-report
+(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
+
+```yaml
+PASTE HERE
+```
+
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..4cf0d28
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,14 @@
+blank_issues_enabled: true
+contact_links:
+ - name: Salt Community Slack
+ url: https://saltstackcommunity.slack.com/
+ about: Please ask and answer questions here.
+ - name: Salt-Users Forum
+ url: https://groups.google.com/forum/#!forum/salt-users
+ about: Please ask and answer questions here.
+ - name: Salt on LiberaChat
+ url: https://web.libera.chat/#salt
+ about: Please ask and answer questions here.
+ - name: Security vulnerabilities
+ email: saltproject-security.pdl@broadcom.com
+ about: Please report security vulnerabilities here.
diff --git a/.github/ISSUE_TEMPLATE/docs.md b/.github/ISSUE_TEMPLATE/docs.md
new file mode 100644
index 0000000..59af749
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/docs.md
@@ -0,0 +1,23 @@
+---
+name: Docs
+about: Issue related to Salt Documentation
+title: "[DOCS]"
+labels: documentation, needs-triage
+assignees: ''
+
+---
+
+**Description**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Suggested Fix**
+What did you expect to see in the documentation that is missing or needs updating?
+
+**Type of documentation**
+This could be module documentation or a guide.
+
+**Location or format of documentation**
+Insert page URL if applicable.
+
+**Additional context**
+Add any other context or screenshots here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..0e0a390
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: "[FEATURE REQUEST]"
+labels: feature, needs-triage
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/tech-debt.md b/.github/ISSUE_TEMPLATE/tech-debt.md
new file mode 100644
index 0000000..5a546c6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/tech-debt.md
@@ -0,0 +1,13 @@
+---
+name: Tech Debt
+about: Issue is related to tech debt. This includes compatibility changes for newer versions of software and OSes that salt interacts with.
+title: "[TECH DEBT]"
+labels: tech-debt
+assignees: ''
+
+---
+
+### Description of the tech debt to be addressed, include links and screenshots
+
+### Versions Report
+(Provided by running `salt --versions-report`. Please also mention any differences in master/minion versions.)
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..7d63a7c
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,24 @@
+### What does this PR do?
+
+### What issues does this PR fix or reference?
+Fixes:
+
+### Previous Behavior
+Remove this section if not relevant
+
+### New Behavior
+Remove this section if not relevant
+
+### Merge requirements satisfied?
+**[NOTICE] Bug fixes or features added to Salt require tests.**
+
+- [ ] Docs
+- [ ] Changelog - https://docs.saltproject.io/en/master/topics/development/changelog.html
+- [ ] Tests written/updated
+
+### Commits signed with GPG?
+Yes/No
+
+Please review [Salt's Contributing Guide](https://docs.saltproject.io/en/master/topics/development/contributing.html) for best practices.
+
+See GitHub's [page on GPG signing](https://help.github.com/articles/signing-commits-using-gpg/) for more information about signing commits with GPG.
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 0000000..c612d7a
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,11 @@
+name: Pull Request or Push
+
+on: [push, pull_request]
+
+jobs:
+ ci:
+ name: CI
+ uses: salt-extensions/central-artifacts/.github/workflows/ci.yml@main
+ permissions:
+ contents: write
+ pull-requests: read
diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml
new file mode 100644
index 0000000..9f86b4e
--- /dev/null
+++ b/.github/workflows/tag.yml
@@ -0,0 +1,26 @@
+name: Tagged Releases
+
+on:
+ push:
+ tags:
+ - "v*"
+
+jobs:
+ ci:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Extract tag name
+ id: get_version
+ run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_ENV
+
+ - name: CI
+ uses: salt-extensions/central-artifacts/.github/workflows/ci.yml@main
+ with:
+ release: true
+ version: ${{ env.VERSION }}
+ permissions:
+ contents: write
+ pull-requests: read
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index 6e535cb..0000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,417 +0,0 @@
-
-name: Testing
-
-on: [push, pull_request]
-
-jobs:
- Pre-Commit:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- with:
- python-version: 3.7
- - name: Set Cache Key
- run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- - name: Install System Deps
- run: |
- sudo apt-get update
- sudo apt-get install -y libxml2 libxml2-dev libxslt-dev
- - uses: actions/cache@v1
- with:
- path: ~/.cache/pre-commit
- key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- - uses: pre-commit/action@v1.0.1
-
- Docs:
- runs-on: ubuntu-latest
- needs: Pre-Commit
-
- timeout-minutes: 10
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up Python 3.7 For Nox
- uses: actions/setup-python@v1
- with:
- python-version: 3.7
-
- - name: Install Nox
- run: |
- python -m pip install --upgrade pip
- pip install nox
-
- - name: Install Doc Requirements
- run: |
- nox --force-color -e docs --install-only
-
- - name: Build Docs
- env:
- SKIP_REQUIREMENTS_INSTALL: YES
- run: |
- nox --force-color -e docs
-
- Linux:
- runs-on: ubuntu-latest
- needs: Pre-Commit
-
- timeout-minutes: 15
-
- strategy:
- fail-fast: false
- max-parallel: 4
- matrix:
- python-version:
- - 3.6
- - 3.7
- - 3.8
- salt-version:
- - 3003
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v1
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install Nox
- run: |
- python -m pip install --upgrade pip
- pip install nox
-
- - name: Install Test Requirements
- env:
- SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
- run: |
- nox --force-color -e tests-3 --install-only
-
- - name: Test
- env:
- SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
- SKIP_REQUIREMENTS_INSTALL: YES
- run: |
- nox --force-color -e tests-3 -- -vv tests/
-
- - name: Create CodeCov Flags
- if: always()
- id: codecov-flags
- run: |
- echo ::set-output name=flags::$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")
-
- - name: Upload Project Code Coverage
- if: always()
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
- REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
- REPORT_PATH: artifacts/coverage-project.xml
- run: |
- if [ ! -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
- if [ -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
-
- - name: Upload Tests Code Coverage
- if: always()
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
- REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
- REPORT_PATH: artifacts/coverage-tests.xml
- run: |
- if [ ! -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
- if [ -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
-
- - name: Upload Logs
- if: always()
- uses: actions/upload-artifact@main
- with:
- name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
- path: artifacts/runtests-*.log
-
- Windows:
- runs-on: windows-latest
- needs: Pre-Commit
-
- timeout-minutes: 40
-
- strategy:
- fail-fast: false
- max-parallel: 3
- matrix:
- python-version:
- - 3.6
- - 3.7
- salt-version:
- - 3003
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v1
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install Nox
- run: |
- python -m pip install --upgrade pip
- pip install nox
-
- - name: Install Test Requirements
- shell: bash
- env:
- SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
- EXTRA_REQUIREMENTS_INSTALL: Cython
- run: |
- export PATH="/C/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64;$PATH"
- nox --force-color -e tests-3 --install-only
-
- - name: Test
- shell: bash
- env:
- SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
- SKIP_REQUIREMENTS_INSTALL: YES
- run: |
- export PATH="/C/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64;$PATH"
- nox --force-color -e tests-3 -- -vv tests/
-
- - name: Create CodeCov Flags
- if: always()
- id: codecov-flags
- run: |
- echo ::set-output name=flags::$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")
-
- - name: Upload Project Code Coverage
- if: always()
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
- REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
- REPORT_PATH: artifacts/coverage-project.xml
- run: |
- if [ ! -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
- if [ -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
-
- - name: Upload Tests Code Coverage
- if: always()
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
- REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
- REPORT_PATH: artifacts/coverage-tests.xml
- run: |
- if [ ! -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
- if [ -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
-
- - name: Upload Logs
- if: always()
- uses: actions/upload-artifact@main
- with:
- name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
- path: artifacts/runtests-*.log
-
- macOS:
- runs-on: macOS-latest
- needs: Pre-Commit
-
- timeout-minutes: 40
-
- strategy:
- fail-fast: false
- max-parallel: 3
- matrix:
- python-version:
- - 3.6
- - 3.7
- salt-version:
- - 3003
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v1
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install Nox
- run: |
- python -m pip install --upgrade pip
- pip install nox
-
- - name: Install Test Requirements
- env:
- SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
- run: |
- nox --force-color -e tests-3 --install-only
-
- - name: Test
- env:
- SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
- SKIP_REQUIREMENTS_INSTALL: YES
- run: |
- nox --force-color -e tests-3 -- -vv tests/
-
- - name: Create CodeCov Flags
- if: always()
- id: codecov-flags
- run: |
- echo ::set-output name=flags::$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")
-
- - name: Upload Project Code Coverage
- if: always()
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
- REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
- REPORT_PATH: artifacts/coverage-project.xml
- run: |
- if [ ! -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
- if [ -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
-
- - name: Upload Tests Code Coverage
- if: always()
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
- REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
- REPORT_PATH: artifacts/coverage-tests.xml
- run: |
- if [ ! -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
- if [ -f codecov.sh ]; then
- n=0
- until [ "$n" -ge 5 ]
- do
- if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
- break
- fi
- n=$((n+1))
- sleep 15
- done
- fi
-
- - name: Upload Logs
- if: always()
- uses: actions/upload-artifact@main
- with:
- name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
- path: artifacts/runtests-*.log
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
old mode 100644
new mode 100755
index 755ed7c..fb63186
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@
minimum_pre_commit_version: 2.4.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.0.1
+ rev: v4.4.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: trailing-whitespace # Trims trailing whitespace.
@@ -37,7 +37,7 @@ repos:
- repo: https://github.com/s0undt3ch/salt-rewrite
# Automatically rewrite code with known rules
- rev: 1.3.3
+ rev: 2.5.2
hooks:
- id: salt-rewrite
alias: rewrite-docstrings
@@ -47,7 +47,7 @@ repos:
- repo: https://github.com/s0undt3ch/salt-rewrite
# Automatically rewrite code with known rules
- rev: 1.3.3
+ rev: 2.5.2
hooks:
- id: salt-rewrite
alias: rewrite-tests
@@ -59,18 +59,18 @@ repos:
rev: v2.37.2
hooks:
- id: pyupgrade
- name: Rewrite Code to be Py3.6+
+ name: Rewrite Code to be Py3.8+
args: [
- --py36-plus
+ --py38-plus
]
exclude: src/saltext/servicenow/version.py
- repo: https://github.com/asottile/reorder_python_imports
- rev: v2.6.0
+ rev: v3.10.0
hooks:
- id: reorder-python-imports
args: [
- --py3-plus,
+ --py38-plus,
]
exclude: src/saltext/servicenow/version.py
@@ -80,10 +80,8 @@ repos:
- id: black
args: [-l 100]
exclude: src/saltext/servicenow/version.py
- additional_dependencies:
- - click<8.1.0
- - repo: https://github.com/asottile/blacken-docs
+ - repo: https://github.com/adamchainz/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
@@ -91,12 +89,11 @@ repos:
files: ^(docs/.*\.rst|src/saltext/servicenow/.*\.py)$
additional_dependencies:
- black==22.6.0
- - click<8.1.0
# <---- Formatting -----------------------------------------------------------------------------
# ----- Security ------------------------------------------------------------------------------>
- repo: https://github.com/PyCQA/bandit
- rev: "1.7.0"
+ rev: "1.7.4"
hooks:
- id: bandit
alias: bandit-salt
@@ -104,7 +101,7 @@ repos:
args: [--silent, -lll, --skip, B701]
exclude: src/saltext/servicenow/version.py
- repo: https://github.com/PyCQA/bandit
- rev: "1.7.0"
+ rev: "1.7.4"
hooks:
- id: bandit
alias: bandit-tests
@@ -121,6 +118,7 @@ repos:
alias: lint-src
name: Lint Source Code
files: ^((setup|noxfile)|src/.*)\.py$
+ require_serial: true
args:
- -e
- lint-code-pre-commit
@@ -133,149 +131,9 @@ repos:
alias: lint-tests
name: Lint Tests
files: ^tests/.*\.py$
+ require_serial: true
args:
- -e
- lint-tests-pre-commit
- --
# <---- Code Analysis --------------------------------------------------------------------------
-
- # ----- Static Test Requirements -------------------------------------------------------------->
- - repo: https://github.com/saltstack/pip-tools-compile-impersonate
- rev: '4.1'
- hooks:
- - id: pip-tools-compile
- alias: compile-3.6-test-requirements
- name: Py3.6 Test Requirements
- files: ^requirements/tests.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.6
- - --platform=linux
- - requirements/tests.in
-
- - id: pip-tools-compile
- alias: compile-3.7-test-requirements
- name: Py3.7 Test Requirements
- files: ^requirements/tests.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.7
- - --platform=linux
- - requirements/tests.in
-
- - id: pip-tools-compile
- alias: compile-3.8-test-requirements
- name: Py3.8 Test Requirements
- files: ^requirements/tests.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.8
- - --platform=linux
- - requirements/tests.in
-
- - id: pip-tools-compile
- alias: compile-3.9-test-requirements
- name: Py3.9 Test Requirements
- files: ^requirements/tests.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.9
- - --platform=linux
- - requirements/tests.in
- # <---- Static Test Requirements ---------------------------------------------------------------
-
- # ----- Static Lint Requirements -------------------------------------------------------------->
- - id: pip-tools-compile
- alias: compile-3.6-test-requirements
- name: Py3.6 Lint Requirements
- files: ^requirements/lint.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.6
- - --platform=linux
- - requirements/lint.in
-
- - id: pip-tools-compile
- alias: compile-3.7-test-requirements
- name: Py3.7 Lint Requirements
- files: ^requirements/lint.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.7
- - --platform=linux
- - requirements/lint.in
-
- - id: pip-tools-compile
- alias: compile-3.8-test-requirements
- name: Py3.8 Lint Requirements
- files: ^requirements/lint.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.8
- - --platform=linux
- - requirements/lint.in
-
- - id: pip-tools-compile
- alias: compile-3.9-test-requirements
- name: Py3.9 Lint Requirements
- files: ^requirements/lint.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.9
- - --platform=linux
- - requirements/lint.in
- # <---- Static Lint Requirements ---------------------------------------------------------------
-
- # ----- Static Docs Requirements -------------------------------------------------------------->
- - id: pip-tools-compile
- alias: compile-3.6-test-requirements
- name: Py3.6 Docs Requirements
- files: ^requirements/docs.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.6
- - --platform=linux
- - requirements/docs.in
-
- - id: pip-tools-compile
- alias: compile-3.7-test-requirements
- name: Py3.7 Docs Requirements
- files: ^requirements/docs.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.7
- - --platform=linux
- - requirements/docs.in
-
- - id: pip-tools-compile
- alias: compile-3.8-test-requirements
- name: Py3.8 Docs Requirements
- files: ^requirements/docs.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.8
- - --platform=linux
- - requirements/docs.in
-
- - id: pip-tools-compile
- alias: compile-3.9-test-requirements
- name: Py3.9 Docs Requirements
- files: ^requirements/docs.in$
- pass_filenames: false
- args:
- - -v
- - --py-version=3.9
- - --platform=linux
- - requirements/docs.in
- # <---- Static Docs Requirements ---------------------------------------------------------------
diff --git a/.pre-commit-hooks/check-cli-examples.py b/.pre-commit-hooks/check-cli-examples.py
index 10d1000..79ce979 100644
--- a/.pre-commit-hooks/check-cli-examples.py
+++ b/.pre-commit-hooks/check-cli-examples.py
@@ -4,7 +4,7 @@
import sys
CODE_ROOT = pathlib.Path(__file__).resolve().parent.parent
-EXECUTION_MODULES_PATH = CODE_ROOT / "src" / "saltext" / " servicenow" / "modules"
+EXECUTION_MODULES_PATH = CODE_ROOT / "src" / "saltext" / "servicenow" / "modules"
def check_cli_examples(files):
diff --git a/.pre-commit-hooks/make-autodocs.py b/.pre-commit-hooks/make-autodocs.py
index e866de1..e840d8f 100644
--- a/.pre-commit-hooks/make-autodocs.py
+++ b/.pre-commit-hooks/make-autodocs.py
@@ -1,59 +1,119 @@
+import ast
+import os.path
import subprocess
-import sys
-from enum import IntEnum
from pathlib import Path
repo_path = Path(subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode().strip())
-src_dir = repo_path / "src" / " saltext" / "servicenow"
+src_dir = repo_path / "src" / "saltext" / "servicenow"
doc_dir = repo_path / "docs"
docs_by_kind = {}
+changed_something = False
+
+
+def _find_virtualname(path):
+ tree = ast.parse(path.read_text())
+ for node in ast.walk(tree):
+ if isinstance(node, ast.Assign):
+ for target in node.targets:
+ if isinstance(target, ast.Name) and target.id == "__virtualname__":
+ if isinstance(node.value, ast.Str):
+ virtualname = node.value.s
+ break
+ else:
+ continue
+ break
+ else:
+ virtualname = path.with_suffix("").name
+ return virtualname
+
+
+def write_module(rst_path, path, use_virtualname=True):
+ if use_virtualname:
+ virtualname = "``" + _find_virtualname(path) + "``"
+ else:
+ virtualname = make_import_path(path)
+ module_contents = f"""\
+{virtualname}
+{'='*len(virtualname)}
+
+.. automodule:: {make_import_path(path)}
+ :members:
+"""
+ if not rst_path.exists() or rst_path.read_text() != module_contents:
+ print(rst_path)
+ rst_path.write_text(module_contents)
+ return True
+ return False
+
+
+def write_index(index_rst, import_paths, kind):
+ if kind == "utils":
+ header_text = "Utilities"
+ common_path = os.path.commonpath(tuple(x.replace(".", "/") for x in import_paths)).replace(
+ "/", "."
+ )
+ if any(x == common_path for x in import_paths):
+ common_path = common_path[: common_path.rfind(".")]
+ else:
+ header_text = (
+ "execution modules" if kind.lower() == "modules" else kind.rstrip("s") + " modules"
+ )
+ common_path = import_paths[0][: import_paths[0].rfind(".")]
+ header = f"{'_'*len(header_text)}\n{header_text.title()}\n{'_'*len(header_text)}"
+ index_contents = f"""\
+.. all-saltext.servicenow.{kind}:
+
+{header}
+
+.. currentmodule:: {common_path}
+
+.. autosummary::
+ :toctree:
+
+{chr(10).join(sorted(' '+p[len(common_path)+1:] for p in import_paths))}
+"""
+ if not index_rst.exists() or index_rst.read_text() != index_contents:
+ print(index_rst)
+ index_rst.write_text(index_contents)
+ return True
+ return False
def make_import_path(path):
- return ".".join(path.with_suffix("").parts[-4:])
+ if path.name == "__init__.py":
+ path = path.parent
+ return ".".join(path.relative_to(repo_path / "src").with_suffix("").parts)
-for path in Path(__file__).parent.parent.joinpath("src/saltext/servicenow/").glob("*/*.py"):
+for path in src_dir.glob("*/*.py"):
if path.name != "__init__.py":
kind = path.parent.name
- docs_by_kind.setdefault(kind, set()).add(path)
+ if kind != "utils":
+ docs_by_kind.setdefault(kind, set()).add(path)
+
+# Utils can have subdirectories, treat them separately
+for path in (src_dir / "utils").rglob("*.py"):
+ if path.name == "__init__.py" and not path.read_text():
+ continue
+ docs_by_kind.setdefault("utils", set()).add(path)
for kind in docs_by_kind:
kind_path = doc_dir / "ref" / kind
- all_rst = kind_path / "all.rst"
+ index_rst = kind_path / "index.rst"
import_paths = []
for path in sorted(docs_by_kind[kind]):
import_path = make_import_path(path)
import_paths.append(import_path)
- rst_path = kind_path.joinpath(import_path).with_suffix(".rst")
- print(rst_path)
+ rst_path = kind_path / (import_path + ".rst")
rst_path.parent.mkdir(parents=True, exist_ok=True)
- rst_path.write_text(
- f"""
-{import_path}
-{'='*len(import_path)}
-
-.. automodule:: {import_path}
- :members:
-"""
- )
+ change = write_module(rst_path, path, use_virtualname=kind != "utils")
+ changed_something = changed_something or change
- header_text = (
- "execution modules" if kind.lower() == "modules" else kind.rstrip("s") + " modules"
- )
- header = f"{'_'*len(header_text)}\n{header_text.title()}\n{'_'*len(header_text)}"
+ write_index(index_rst, import_paths, kind)
- all_rst.write_text(
- f"""
-.. all-saltext.servicenow.{kind}:
-
-{header}
-.. autosummary::
- :toctree:
-
-{chr(10).join(sorted(' '+p for p in import_paths))}
-"""
- )
+# Ensure pre-commit realizes we did something
+if changed_something:
+ exit(2)
diff --git a/.pylintrc b/.pylintrc
old mode 100644
new mode 100755
index 7fb0a22..5692f3b
--- a/.pylintrc
+++ b/.pylintrc
@@ -72,7 +72,7 @@ ignored-modules=
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use, and will cap the count on Windows to
# avoid hangs.
-jobs=1
+jobs=0
# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..aec3363
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,5 @@
+The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
+
+This project uses [Semantic Versioning](https://semver.org/) - MAJOR.MINOR.PATCH
+
+# Changelog
diff --git a/LICENSE b/LICENSE
index a92dcb5..cbfdcf2 100644
--- a/LICENSE
+++ b/LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2023 EITR Technologies
+ Copyright 2024 EITR Technologies, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/README.md b/README.md
index 71f3b7d..d2acc4c 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,86 @@
-# servicenow
+# Salt Extension for Servicenow
-Salt Extension for interacting with ServiceNow
+Salt Extension for interacting with Servicenow
-## Quickstart
+## Security
-To get started with your new project:
+If you think you've found a security vulnerability, see
+[Salt's security guide][security].
- # Create a new venv
- python3 -m venv env --prompt servicenow
- source env/bin/activate
+## User Documentation
- # On mac, you may need to upgrade pip
- python -m pip install --upgrade pip
+This README is for people aiming to contribute to the project.
+If you just want to get started with the extension, check out the
+module docstrings (for now, documentation is coming!).
- # On WSL or some flavors of linux you may need to install the `enchant`
- # library in order to build the docs
- sudo apt-get install -y enchant
+## Contributing
- # Install extension + test/dev/doc dependencies into your environment
- python -m pip install -e .[tests,dev,docs]
+The saltext-servicenow project team welcomes contributions from the community.
- # Run tests!
- python -m nox -e tests-3
+The [Salt Contributing guide][salt-contributing] has a lot of relevant
+information, but if you'd like to jump right in here's how to get started:
- # skip requirements install for next time
- export SKIP_REQUIREMENTS_INSTALL=1
- # Build the docs, serve, and view in your web browser:
- python -m nox -e docs && (cd docs/_build/html; python -m webbrowser localhost:8000; python -m http.server; cd -)
+```bash
+# Clone the repo
+git clone --origin salt git@github.com:salt-extensions/saltext-servicenow.git
- # Run the example function
- salt-call --local servicenow.example_function text="Happy Hacking!"
+# Change to the repo dir
+cd saltext-servicenow
+
+# Create a new venv
+python3 -m venv env --prompt saltext-servicenow
+source env/bin/activate
+
+# On mac, you may need to upgrade pip
+python -m pip install --upgrade pip
+
+# On WSL or some flavors of linux you may need to install the `enchant`
+# library in order to build the docs
+sudo apt-get install -y enchant
+
+# Install extension + test/dev/doc dependencies into your environment
+python -m pip install -e '.[tests,dev,docs]'
+
+# Run tests!
+python -m nox -e tests-3
+
+# skip requirements install for next time
+export SKIP_REQUIREMENTS_INSTALL=1
+
+# Build the docs, serve, and view in your web browser:
+python -m nox -e docs && (cd docs/_build/html; python -m webbrowser localhost:8000; python -m http.server; cd -)
+```
+
+Writing code isn't the only way to contribute! We value contributions in any of
+these areas:
+
+* Documentation - especially examples of how to use this module to solve
+ specific problems.
+* Triaging [issues][issues] and participating in [discussions][discussions]
+* Reviewing [Pull Requests][PRs] (we really like
+ [Conventional Comments][comments]!)
+
+You could also contribute in other ways:
+
+* Writing blog posts
+* Posting on social media about how you used Salt+Servicenow to solve your
+ problems, including videos
+* Giving talks at conferences
+* Publishing videos
+* Asking/answering questions in IRC, Slack, or email groups
+
+Any of these things are super valuable to our community, and we sincerely
+appreciate every contribution!
+
+
+For more information, build the docs and head over to http://localhost:8000/ —
+that's where you'll find the rest of the documentation.
+
+
+[security]: https://github.com/saltstack/salt/blob/master/SECURITY.md
+[salt-contributing]: https://docs.saltproject.io/en/master/topics/development/contributing.html
+[issues]: https://github.com/salt-extensions/saltext-servicenow/issues
+[PRs]: https://github.com/salt-extensions/saltext-servicenow/pulls
+[discussions]: https://github.com/salt-extensions/saltext-servicenow/discussions
+[comments]: https://conventionalcomments.org/
diff --git a/changelog/.template.jinja b/changelog/.template.jinja
new file mode 100644
index 0000000..0cf429a
--- /dev/null
+++ b/changelog/.template.jinja
@@ -0,0 +1,15 @@
+{% if sections[""] %}
+{% for category, val in definitions.items() if category in sections[""] %}
+
+### {{ definitions[category]['name'] }}
+
+{% for text, values in sections[""][category].items() %}
+- {{ text }} {{ values|join(', ') }}
+{% endfor %}
+
+{% endfor %}
+{% else %}
+No significant changes.
+
+
+{% endif %}
diff --git a/docs/all.rst b/docs/all.rst
deleted file mode 100644
index 8143e2c..0000000
--- a/docs/all.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-.. _all the states/modules:
-
-Complete List of servicenow
-===========================
-
-
-.. toctree::
- :maxdepth: 2
-
- ref/modules.rst
-
-
-.. toctree::
- :maxdepth: 2
-
- ref/states.rst
diff --git a/docs/changelog.md b/docs/changelog.md
new file mode 100644
index 0000000..2f5367b
--- /dev/null
+++ b/docs/changelog.md
@@ -0,0 +1,12 @@
+# Changelog
+
+The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
+
+This project uses [Semantic Versioning](https://semver.org/) - MAJOR.MINOR.PATCH
+
+```{towncrier-draft-entries}
+```
+
+```{include} ../CHANGELOG.md
+:start-after: '# Changelog'
+```
diff --git a/docs/conf.py b/docs/conf.py
old mode 100644
new mode 100755
index 056cfd9..f1e29e8
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -9,8 +9,10 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import datetime
+import email.policy
import os
import sys
+from pathlib import Path
try:
from importlib_metadata import distribution
@@ -25,6 +27,8 @@
# assume we're in the doc/ directory
docs_basepath = os.path.abspath(os.path.dirname("."))
+PROJECT_ROOT_DIR = Path(docs_basepath).parent
+
addtl_paths = (
os.path.join(os.pardir, "src"), # saltext.servicenow itself (for autodoc)
"_ext", # custom Sphinx extensions
@@ -44,6 +48,19 @@
copyright_year = f"2021 - {this_year}"
project = dist.metadata["Summary"]
author = dist.metadata["Author"]
+
+if author is None:
+ # Core metadata is serialized differently with pyproject.toml:
+ # https://packaging.python.org/en/latest/specifications/pyproject-toml/#authors-maintainers
+ author_email = dist.metadata["Author-email"]
+ em = email.message_from_string(
+ f"To: {author_email}",
+ policy=email.policy.default,
+ )
+ if em["To"].addresses and em["To"].addresses[0]:
+ author = em["To"].addresses[0].display_name
+ author = author or ""
+
copyright = f"{copyright_year}, {author}"
# The full version, including alpha/beta/rc tags
@@ -75,6 +92,15 @@
"sphinx.ext.coverage",
"sphinx_copybutton",
"sphinxcontrib.spelling",
+ "sphinxcontrib.towncrier.ext",
+ "myst_parser",
+ "sphinx_inline_tabs",
+]
+
+myst_enable_extensions = [
+ "colon_fence",
+ "deflist",
+ "tasklist",
]
# Add any paths that contain templates here, relative to this directory.
@@ -95,7 +121,7 @@
"sitevars.rst",
]
-autosummary_generate = True
+autosummary_generate = False
# -- Options for HTML output -------------------------------------------------
@@ -136,7 +162,7 @@
# ----- Intersphinx Config ---------------------------------------------------------------------------------------->
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
- "pytest": ("https://pytest.readthedocs.io/en/stable", None),
+ "pytest": ("https://docs.pytest.org/en/stable", None),
"salt": ("https://docs.saltproject.io/en/latest", None),
}
# <---- Intersphinx Config -----------------------------------------------------------------------------------------
@@ -146,6 +172,11 @@
autodoc_mock_imports = ["salt"]
# <---- Autodoc Config -----------------------------------------------------------------------------------------------
+# Towncrier draft config
+towncrier_draft_autoversion_mode = "sphinx-release"
+towncrier_draft_include_empty = True
+towncrier_draft_working_directory = str(PROJECT_ROOT_DIR)
+
def setup(app):
app.add_crossref_type(
diff --git a/docs/index.rst b/docs/index.rst
index a1d9d8e..90e9a74 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,11 +1,29 @@
-Welcome to servicenow Documentation!
-====================================
+``saltext-servicenow``: Integrate Salt with Servicenow
+======================================================
+
+Salt Extension for interacting with Servicenow
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Guides
+ :hidden:
+
+ topics/installation
.. toctree::
:maxdepth: 2
- :caption: Contents:
+ :caption: Provided Modules
+ :hidden:
+
+ ref/modules/index
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Reference
+ :hidden:
+
+ changelog
- all.rst
Indices and tables
==================
diff --git a/docs/ref/modules/all/salt.modules.servicenow.rst b/docs/ref/modules/all/salt.modules.servicenow.rst
deleted file mode 100644
index 1b02059..0000000
--- a/docs/ref/modules/all/salt.modules.servicenow.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-salt.modules.servicenow
-=======================
-
-.. automodule:: salt.modules.servicenow
- :members:
- :undoc-members:
diff --git a/docs/ref/modules/index.rst b/docs/ref/modules/index.rst
new file mode 100644
index 0000000..277861f
--- /dev/null
+++ b/docs/ref/modules/index.rst
@@ -0,0 +1,12 @@
+.. all-saltext.servicenow.modules:
+
+_________________
+Execution Modules
+_________________
+
+.. currentmodule:: saltext.servicenow.modules
+
+.. autosummary::
+ :toctree:
+
+ servicenow
diff --git a/docs/ref/modules/saltext.servicenow.modules.servicenow.rst b/docs/ref/modules/saltext.servicenow.modules.servicenow.rst
new file mode 100644
index 0000000..0d3176e
--- /dev/null
+++ b/docs/ref/modules/saltext.servicenow.modules.servicenow.rst
@@ -0,0 +1,5 @@
+``servicenow``
+==============
+
+.. automodule:: saltext.servicenow.modules.servicenow
+ :members:
diff --git a/docs/topics/installation.md b/docs/topics/installation.md
new file mode 100644
index 0000000..5c847f5
--- /dev/null
+++ b/docs/topics/installation.md
@@ -0,0 +1,36 @@
+# Installation
+
+Generally, extensions need to be installed into the same Python environment Salt uses.
+
+:::{tab} State
+```yaml
+Install Salt Servicenow extension:
+ pip.installed:
+ - name: saltext-servicenow
+```
+:::
+
+:::{tab} Onedir installation
+```bash
+salt-pip install saltext-servicenow
+```
+:::
+
+:::{tab} Regular installation
+```bash
+pip install saltext-servicenow
+```
+:::
+
+:::{important}
+Currently, there is [an issue][issue-second-saltext] where the installation of a Saltext fails silently
+if the environment already has another one installed. You can workaround this by
+removing all Saltexts and reinstalling them in one transaction.
+:::
+
+:::{hint}
+Saltexts are not distributed automatically via the fileserver like custom modules, they need to be installed
+on each node you want them to be available on.
+:::
+
+[issue-second-saltext]: https://github.com/saltstack/salt/issues/65433
diff --git a/noxfile.py b/noxfile.py
old mode 100644
new mode 100755
index 09b380f..0377d3b
--- a/noxfile.py
+++ b/noxfile.py
@@ -19,7 +19,7 @@
nox.options.error_on_missing_interpreters = False
# Python versions to test against
-PYTHON_VERSIONS = ("3", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10")
+PYTHON_VERSIONS = ("3", "3.8", "3.9", "3.10")
# Be verbose when running under a CI context
CI_RUN = (
os.environ.get("JENKINS_URL") or os.environ.get("CI") or os.environ.get("DRONE") is not None
@@ -29,7 +29,7 @@
EXTRA_REQUIREMENTS_INSTALL = os.environ.get("EXTRA_REQUIREMENTS_INSTALL")
COVERAGE_VERSION_REQUIREMENT = "coverage==5.2"
-SALT_REQUIREMENT = os.environ.get("SALT_REQUIREMENT") or "salt>=3003"
+SALT_REQUIREMENT = os.environ.get("SALT_REQUIREMENT") or "salt>=3005"
if SALT_REQUIREMENT == "salt==master":
SALT_REQUIREMENT = "git+https://github.com/saltstack/salt.git@master"
@@ -70,8 +70,8 @@ def _get_session_python_version_info(session):
def _get_pydir(session):
version_info = _get_session_python_version_info(session)
- if version_info < (3, 5):
- session.error("Only Python >= 3.5 is supported")
+ if version_info < (3, 8):
+ session.error("Only Python >= 3.8 is supported")
return f"py{version_info[0]}.{version_info[1]}"
diff --git a/pyproject.toml b/pyproject.toml
index b3162ec..4b2020d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,10 +1,142 @@
[build-system]
-requires = ["setuptools>=50.3.2", "wheel", "setuptools-declarative-requirements", "setuptools_scm[toml]>=3.4"]
+requires = [
+ "wheel",
+ "setuptools>=50.3.2",
+ "setuptools_scm[toml]>=3.4",
+]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "src/saltext/servicenow/version.py"
write_to_template = "__version__ = \"{version}\""
+[project]
+name = "saltext.servicenow"
+description = "Salt Extension for interacting with Servicenow"
+authors = [
+ {name = "EITR Technologies, LLC", email = "devops@eitr.tech"},
+]
+keywords = [
+ "salt-extension",
+]
+license = {text = "Apache Software License"}
+classifiers = [
+ "Programming Language :: Python",
+ "Programming Language :: Cython",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3 :: Only",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+]
+requires-python = ">= 3.8"
+dynamic = ["version"]
+dependencies = []
+
+[project.readme]
+file = "README.md"
+content-type = "text/markdown"
+
+[project.urls]
+Homepage = "https://github.com/salt-extensions/saltext-servicenow"
+Source = "https://github.com/salt-extensions/saltext-servicenow"
+Tracker = "https://github.com/salt-extensions/saltext-servicenow/issues"
+
+[project.optional-dependencies]
+changelog = ["towncrier==22.12.0"]
+dev = [
+ "nox",
+ "pre-commit>=2.4.0",
+ "pylint",
+ "saltpylint",
+]
+docs = [
+ "sphinx",
+ "sphinx-prompt",
+ "sphinxcontrib-spelling",
+ "sphinx-copybutton",
+ "towncrier==22.12.0",
+ "sphinxcontrib-towncrier",
+ "myst_parser",
+ "furo",
+ "sphinx-inline-tabs",
+]
+docsauto = ["sphinx-autobuild"]
+lint = [
+ "pylint",
+ "saltpylint",
+]
+tests = [
+ "pytest>=6.1.0",
+ "pytest-salt-factories>=1.0.0rc19",
+]
+
+[project.entry-points."salt.loader"]
+"saltext.servicenow" = "saltext.servicenow"
+
+[tool.setuptools]
+zip-safe = false
+include-package-data = true
+platforms = ["any"]
+
+[tool.setuptools.packages.find]
+where = ["src"]
+exclude = ["tests"]
+
+[tool.distutils.bdist_wheel]
+# Use this option if your package is pure-python
+universal = 1
+
+[tool.distutils.sdist]
+owner = "root"
+group = "root"
+
+[tool.build_sphinx]
+source_dir = "docs"
+build_dir = "build/sphinx"
+
[tool.black]
line-length = 100
+
+[tool.towncrier]
+ package = "saltext.servicenow"
+ filename = "CHANGELOG.md"
+ template = "changelog/.template.jinja"
+ directory = "changelog/"
+ start_string = "# Changelog\n"
+ underlines = ["", "", ""]
+ title_format = "## {version} ({project_date})"
+ issue_format = "[#{issue}](https://github.com/salt-extensions/saltext-servicenow/issues/{issue})"
+
+ [[tool.towncrier.type]]
+ directory = "removed"
+ name = "Removed"
+ showcontent = true
+
+ [[tool.towncrier.type]]
+ directory = "deprecated"
+ name = "Deprecated"
+ showcontent = true
+
+ [[tool.towncrier.type]]
+ directory = "changed"
+ name = "Changed"
+ showcontent = true
+
+ [[tool.towncrier.type]]
+ directory = "fixed"
+ name = "Fixed"
+ showcontent = true
+
+ [[tool.towncrier.type]]
+ directory = "added"
+ name = "Added"
+ showcontent = true
+
+ [[tool.towncrier.type]]
+ directory = "security"
+ name = "Security"
+ showcontent = true
diff --git a/requirements/base.txt b/requirements/base.txt
deleted file mode 100644
index bcd4f13..0000000
--- a/requirements/base.txt
+++ /dev/null
@@ -1 +0,0 @@
-salt>=3003
diff --git a/requirements/docs.in b/requirements/docs.in
deleted file mode 100644
index 1542731..0000000
--- a/requirements/docs.in
+++ /dev/null
@@ -1,5 +0,0 @@
-sphinx
-sphinx-material-saltstack
-sphinx-prompt
-sphinxcontrib-spelling
-importlib_metadata; python_version < "3.8"
diff --git a/requirements/lint.in b/requirements/lint.in
deleted file mode 100644
index 911de93..0000000
--- a/requirements/lint.in
+++ /dev/null
@@ -1,2 +0,0 @@
-pylint
-saltpylint
diff --git a/requirements/lint.txt b/requirements/lint.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/requirements/py3.5/docs.txt b/requirements/py3.5/docs.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/requirements/py3.5/lint.txt b/requirements/py3.5/lint.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/requirements/py3.5/tests.txt b/requirements/py3.5/tests.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/requirements/py3.6/docs.txt b/requirements/py3.6/docs.txt
deleted file mode 100644
index 273b81d..0000000
--- a/requirements/py3.6/docs.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.6/docs.txt requirements/docs.in
-#
-alabaster==0.7.13
- # via sphinx
-babel==2.11.0
- # via sphinx
-beautifulsoup4==4.9.1
- # via sphinx-material-saltstack
-certifi==2023.11.17
- # via requests
-charset-normalizer==2.0.12
- # via requests
-css-html-js-minify==2.5.5
- # via sphinx-material-saltstack
-docutils==0.18.1
- # via sphinx
-idna==3.6
- # via requests
-imagesize==1.4.1
- # via sphinx
-importlib-metadata==4.8.3 ; python_version < "3.8"
- # via
- # -r requirements/docs.in
- # sphinx
- # sphinxcontrib-spelling
-jinja2==3.0.3
- # via sphinx
-lxml==4.5.2
- # via sphinx-material-saltstack
-markupsafe==2.0.1
- # via jinja2
-packaging==21.3
- # via sphinx
-pyenchant==3.2.2
- # via sphinxcontrib-spelling
-pygments==2.14.0
- # via
- # sphinx
- # sphinx-prompt
-pyparsing==3.0.7
- # via packaging
-python-slugify[unidecode]==4.0.1
- # via sphinx-material-saltstack
-pytz==2023.3.post1
- # via babel
-requests==2.27.1
- # via sphinx
-snowballstemmer==2.2.0
- # via sphinx
-soupsieve==2.3.2.post1
- # via beautifulsoup4
-sphinx-material-saltstack==1.0.5
- # via -r requirements/docs.in
-sphinx-prompt==1.5.0
- # via -r requirements/docs.in
-sphinx==5.3.0
- # via
- # -r requirements/docs.in
- # sphinx-material-saltstack
- # sphinx-prompt
- # sphinxcontrib-spelling
-sphinxcontrib-applehelp==1.0.2
- # via sphinx
-sphinxcontrib-devhelp==1.0.2
- # via sphinx
-sphinxcontrib-htmlhelp==2.0.0
- # via sphinx
-sphinxcontrib-jsmath==1.0.1
- # via sphinx
-sphinxcontrib-qthelp==1.0.3
- # via sphinx
-sphinxcontrib-serializinghtml==1.1.5
- # via sphinx
-sphinxcontrib-spelling==7.7.0
- # via -r requirements/docs.in
-text-unidecode==1.3
- # via python-slugify
-typing-extensions==4.1.1
- # via importlib-metadata
-unidecode==1.3.7
- # via python-slugify
-urllib3==1.26.18
- # via requests
-zipp==3.6.0
- # via importlib-metadata
diff --git a/requirements/py3.6/lint.txt b/requirements/py3.6/lint.txt
deleted file mode 100644
index 4ae2428..0000000
--- a/requirements/py3.6/lint.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.6/lint.txt requirements/lint.in
-#
-astroid==2.11.7
- # via pylint
-dill==0.3.4
- # via pylint
-isort==5.10.1
- # via pylint
-lazy-object-proxy==1.7.1
- # via astroid
-mccabe==0.7.0
- # via pylint
-modernize==0.5
- # via saltpylint
-platformdirs==2.4.0
- # via pylint
-pycodestyle==2.10.0
- # via saltpylint
-pylint==2.13.9
- # via
- # -r requirements/lint.in
- # saltpylint
-saltpylint==2023.8.3
- # via -r requirements/lint.in
-tomli==1.2.3
- # via pylint
-typed-ast==1.5.5
- # via astroid
-typing-extensions==4.1.1
- # via
- # astroid
- # pylint
-wrapt==1.16.0
- # via astroid
-
-# The following packages are considered to be unsafe in a requirements file:
-# setuptools
diff --git a/requirements/py3.6/tests.txt b/requirements/py3.6/tests.txt
deleted file mode 100644
index 384335a..0000000
--- a/requirements/py3.6/tests.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.6/tests.txt requirements/tests.in
-#
-attrs==22.2.0
- # via
- # pytest
- # pytest-salt-factories
- # pytest-skip-markers
-distlib==0.3.7
- # via virtualenv
-distro==1.8.0
- # via pytest-skip-markers
-filelock==3.4.1
- # via virtualenv
-importlib-metadata==4.8.3
- # via
- # pluggy
- # pytest
- # virtualenv
-importlib-resources==5.4.0
- # via virtualenv
-iniconfig==1.1.1
- # via pytest
-msgpack==1.0.5
- # via pytest-salt-factories
-packaging==21.3
- # via pytest
-platformdirs==2.4.0
- # via virtualenv
-pluggy==1.0.0
- # via pytest
-psutil==5.9.6
- # via pytest-salt-factories
-py==1.11.0
- # via pytest
-pyparsing==3.0.7
- # via packaging
-pytest-helpers-namespace==2021.12.29
- # via pytest-salt-factories
-pytest-salt-factories==0.912.2
- # via -r requirements/tests.in
-pytest-skip-markers==1.3.0
- # via pytest-salt-factories
-pytest-tempdir==2019.10.12
- # via pytest-salt-factories
-pytest==7.0.1
- # via
- # -r requirements/tests.in
- # pytest-helpers-namespace
- # pytest-salt-factories
- # pytest-skip-markers
- # pytest-tempdir
-pyzmq==25.1.2
- # via pytest-salt-factories
-tomli==1.2.3
- # via pytest
-typing-extensions==4.1.1
- # via importlib-metadata
-virtualenv==20.17.1
- # via pytest-salt-factories
-zipp==3.6.0
- # via
- # importlib-metadata
- # importlib-resources
diff --git a/requirements/py3.7/docs.txt b/requirements/py3.7/docs.txt
deleted file mode 100644
index 4c43406..0000000
--- a/requirements/py3.7/docs.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.7/docs.txt requirements/docs.in
-#
-alabaster==0.7.13
- # via sphinx
-babel==2.13.1
- # via sphinx
-beautifulsoup4==4.9.1
- # via sphinx-material-saltstack
-certifi==2023.11.17
- # via requests
-charset-normalizer==3.3.2
- # via requests
-css-html-js-minify==2.5.5
- # via sphinx-material-saltstack
-docutils==0.19
- # via sphinx
-idna==3.6
- # via requests
-imagesize==1.4.1
- # via sphinx
-importlib-metadata==6.7.0 ; python_version < "3.8"
- # via
- # -r requirements/docs.in
- # sphinx
- # sphinxcontrib-spelling
-jinja2==3.1.2
- # via sphinx
-lxml==4.5.2
- # via sphinx-material-saltstack
-markupsafe==2.1.3
- # via jinja2
-packaging==23.2
- # via sphinx
-pyenchant==3.2.2
- # via sphinxcontrib-spelling
-pygments==2.17.2
- # via
- # sphinx
- # sphinx-prompt
-python-slugify[unidecode]==4.0.1
- # via sphinx-material-saltstack
-pytz==2023.3.post1
- # via babel
-requests==2.31.0
- # via sphinx
-snowballstemmer==2.2.0
- # via sphinx
-soupsieve==2.4.1
- # via beautifulsoup4
-sphinx-material-saltstack==1.0.5
- # via -r requirements/docs.in
-sphinx-prompt==1.5.0
- # via -r requirements/docs.in
-sphinx==5.3.0
- # via
- # -r requirements/docs.in
- # sphinx-material-saltstack
- # sphinx-prompt
- # sphinxcontrib-spelling
-sphinxcontrib-applehelp==1.0.2
- # via sphinx
-sphinxcontrib-devhelp==1.0.2
- # via sphinx
-sphinxcontrib-htmlhelp==2.0.0
- # via sphinx
-sphinxcontrib-jsmath==1.0.1
- # via sphinx
-sphinxcontrib-qthelp==1.0.3
- # via sphinx
-sphinxcontrib-serializinghtml==1.1.5
- # via sphinx
-sphinxcontrib-spelling==8.0.0
- # via -r requirements/docs.in
-text-unidecode==1.3
- # via python-slugify
-typing-extensions==4.7.1
- # via importlib-metadata
-unidecode==1.3.7
- # via python-slugify
-urllib3==2.0.7
- # via requests
-zipp==3.15.0
- # via importlib-metadata
diff --git a/requirements/py3.7/lint.txt b/requirements/py3.7/lint.txt
deleted file mode 100644
index 4eda0b4..0000000
--- a/requirements/py3.7/lint.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.7/lint.txt requirements/lint.in
-#
-astroid==2.15.8
- # via pylint
-dill==0.3.7
- # via pylint
-isort==5.11.5
- # via pylint
-lazy-object-proxy==1.9.0
- # via astroid
-mccabe==0.7.0
- # via pylint
-modernize==0.5
- # via saltpylint
-platformdirs==4.0.0
- # via pylint
-pycodestyle==2.10.0
- # via saltpylint
-pylint==2.17.7
- # via
- # -r requirements/lint.in
- # saltpylint
-saltpylint==2023.8.3
- # via -r requirements/lint.in
-tomli==2.0.1
- # via pylint
-tomlkit==0.12.3
- # via pylint
-typed-ast==1.5.5
- # via astroid
-typing-extensions==4.7.1
- # via
- # astroid
- # platformdirs
- # pylint
-wrapt==1.16.0
- # via astroid
diff --git a/requirements/py3.7/tests.txt b/requirements/py3.7/tests.txt
deleted file mode 100644
index 7b0cc07..0000000
--- a/requirements/py3.7/tests.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.7/tests.txt requirements/tests.in
-#
-attrs==23.1.0
- # via
- # pytest-salt-factories
- # pytest-skip-markers
-distlib==0.3.7
- # via virtualenv
-distro==1.8.0
- # via pytest-skip-markers
-exceptiongroup==1.2.0
- # via pytest
-filelock==3.12.2
- # via virtualenv
-importlib-metadata==6.7.0
- # via
- # attrs
- # pluggy
- # pytest
- # virtualenv
-iniconfig==2.0.0
- # via pytest
-msgpack==1.0.5
- # via pytest-salt-factories
-packaging==23.2
- # via pytest
-platformdirs==4.0.0
- # via virtualenv
-pluggy==1.2.0
- # via pytest
-psutil==5.9.6
- # via pytest-salt-factories
-pytest-helpers-namespace==2021.12.29
- # via pytest-salt-factories
-pytest-salt-factories==0.912.2
- # via -r requirements/tests.in
-pytest-skip-markers==1.5.0
- # via pytest-salt-factories
-pytest-tempdir==2019.10.12
- # via pytest-salt-factories
-pytest==7.4.3
- # via
- # -r requirements/tests.in
- # pytest-helpers-namespace
- # pytest-salt-factories
- # pytest-skip-markers
- # pytest-tempdir
-pyzmq==25.1.2
- # via pytest-salt-factories
-tomli==2.0.1
- # via pytest
-typing-extensions==4.7.1
- # via
- # importlib-metadata
- # platformdirs
-virtualenv==20.25.0
- # via pytest-salt-factories
-zipp==3.15.0
- # via importlib-metadata
diff --git a/requirements/py3.8/docs.txt b/requirements/py3.8/docs.txt
deleted file mode 100644
index 3962674..0000000
--- a/requirements/py3.8/docs.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.8/docs.txt requirements/docs.in
-#
-alabaster==0.7.13
- # via sphinx
-babel==2.13.1
- # via sphinx
-beautifulsoup4==4.9.1
- # via sphinx-material-saltstack
-certifi==2023.11.17
- # via requests
-charset-normalizer==3.3.2
- # via requests
-css-html-js-minify==2.5.5
- # via sphinx-material-saltstack
-docutils==0.20.1
- # via
- # sphinx
- # sphinx-prompt
-idna==3.6
- # via requests
-imagesize==1.4.1
- # via sphinx
-importlib-metadata==7.0.0
- # via sphinx
-jinja2==3.1.2
- # via sphinx
-lxml==4.5.2
- # via sphinx-material-saltstack
-markupsafe==2.1.3
- # via jinja2
-packaging==23.2
- # via sphinx
-pyenchant==3.2.2
- # via sphinxcontrib-spelling
-pygments==2.17.2
- # via
- # sphinx
- # sphinx-prompt
-python-slugify[unidecode]==4.0.1
- # via sphinx-material-saltstack
-pytz==2023.3.post1
- # via babel
-requests==2.31.0
- # via sphinx
-snowballstemmer==2.2.0
- # via sphinx
-soupsieve==2.5
- # via beautifulsoup4
-sphinx-material-saltstack==1.0.5
- # via -r requirements/docs.in
-sphinx-prompt==1.7.0
- # via -r requirements/docs.in
-sphinx==7.1.2
- # via
- # -r requirements/docs.in
- # sphinx-material-saltstack
- # sphinx-prompt
- # sphinxcontrib-spelling
-sphinxcontrib-applehelp==1.0.4
- # via sphinx
-sphinxcontrib-devhelp==1.0.2
- # via sphinx
-sphinxcontrib-htmlhelp==2.0.1
- # via sphinx
-sphinxcontrib-jsmath==1.0.1
- # via sphinx
-sphinxcontrib-qthelp==1.0.3
- # via sphinx
-sphinxcontrib-serializinghtml==1.1.5
- # via sphinx
-sphinxcontrib-spelling==8.0.0
- # via -r requirements/docs.in
-text-unidecode==1.3
- # via python-slugify
-unidecode==1.3.7
- # via python-slugify
-urllib3==2.1.0
- # via requests
-zipp==3.17.0
- # via importlib-metadata
diff --git a/requirements/py3.8/lint.txt b/requirements/py3.8/lint.txt
deleted file mode 100644
index 06c1aea..0000000
--- a/requirements/py3.8/lint.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.8/lint.txt requirements/lint.in
-#
-astroid==3.0.1
- # via pylint
-dill==0.3.7
- # via pylint
-isort==5.12.0
- # via pylint
-mccabe==0.7.0
- # via pylint
-modernize==0.5
- # via saltpylint
-platformdirs==4.1.0
- # via pylint
-pycodestyle==2.11.1
- # via saltpylint
-pylint==3.0.2
- # via
- # -r requirements/lint.in
- # saltpylint
-saltpylint==2023.8.3
- # via -r requirements/lint.in
-tomli==2.0.1
- # via pylint
-tomlkit==0.12.3
- # via pylint
-typing-extensions==4.8.0
- # via
- # astroid
- # pylint
diff --git a/requirements/py3.8/tests.txt b/requirements/py3.8/tests.txt
deleted file mode 100644
index 6c0bf1b..0000000
--- a/requirements/py3.8/tests.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.8/tests.txt requirements/tests.in
-#
-attrs==23.1.0
- # via
- # pytest-salt-factories
- # pytest-skip-markers
-distlib==0.3.7
- # via virtualenv
-distro==1.8.0
- # via pytest-skip-markers
-exceptiongroup==1.2.0
- # via pytest
-filelock==3.13.1
- # via virtualenv
-iniconfig==2.0.0
- # via pytest
-msgpack==1.0.7
- # via pytest-salt-factories
-packaging==23.2
- # via pytest
-platformdirs==4.1.0
- # via virtualenv
-pluggy==1.3.0
- # via pytest
-psutil==5.9.6
- # via pytest-salt-factories
-pytest-helpers-namespace==2021.12.29
- # via pytest-salt-factories
-pytest-salt-factories==0.912.2
- # via -r requirements/tests.in
-pytest-skip-markers==1.5.0
- # via pytest-salt-factories
-pytest-tempdir==2019.10.12
- # via pytest-salt-factories
-pytest==7.4.3
- # via
- # -r requirements/tests.in
- # pytest-helpers-namespace
- # pytest-salt-factories
- # pytest-skip-markers
- # pytest-tempdir
-pyzmq==25.1.2
- # via pytest-salt-factories
-tomli==2.0.1
- # via pytest
-virtualenv==20.25.0
- # via pytest-salt-factories
diff --git a/requirements/py3.9/docs.txt b/requirements/py3.9/docs.txt
deleted file mode 100644
index ba7b389..0000000
--- a/requirements/py3.9/docs.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.9/docs.txt requirements/docs.in
-#
-alabaster==0.7.13
- # via sphinx
-babel==2.13.1
- # via sphinx
-beautifulsoup4==4.9.1
- # via sphinx-material-saltstack
-certifi==2023.11.17
- # via requests
-charset-normalizer==3.3.2
- # via requests
-css-html-js-minify==2.5.5
- # via sphinx-material-saltstack
-docutils==0.20.1
- # via
- # sphinx
- # sphinx-prompt
-idna==3.6
- # via requests
-imagesize==1.4.1
- # via sphinx
-importlib-metadata==7.0.0
- # via sphinx
-jinja2==3.1.2
- # via sphinx
-lxml==4.5.2
- # via sphinx-material-saltstack
-markupsafe==2.1.3
- # via jinja2
-packaging==23.2
- # via sphinx
-pyenchant==3.2.2
- # via sphinxcontrib-spelling
-pygments==2.17.2
- # via
- # sphinx
- # sphinx-prompt
-python-slugify[unidecode]==4.0.1
- # via sphinx-material-saltstack
-requests==2.31.0
- # via sphinx
-snowballstemmer==2.2.0
- # via sphinx
-soupsieve==2.5
- # via beautifulsoup4
-sphinx-material-saltstack==1.0.5
- # via -r requirements/docs.in
-sphinx-prompt==1.8.0
- # via -r requirements/docs.in
-sphinx==7.2.6
- # via
- # -r requirements/docs.in
- # sphinx-material-saltstack
- # sphinx-prompt
- # sphinxcontrib-applehelp
- # sphinxcontrib-devhelp
- # sphinxcontrib-htmlhelp
- # sphinxcontrib-qthelp
- # sphinxcontrib-serializinghtml
- # sphinxcontrib-spelling
-sphinxcontrib-applehelp==1.0.7
- # via sphinx
-sphinxcontrib-devhelp==1.0.5
- # via sphinx
-sphinxcontrib-htmlhelp==2.0.4
- # via sphinx
-sphinxcontrib-jsmath==1.0.1
- # via sphinx
-sphinxcontrib-qthelp==1.0.6
- # via sphinx
-sphinxcontrib-serializinghtml==1.1.9
- # via sphinx
-sphinxcontrib-spelling==8.0.0
- # via -r requirements/docs.in
-text-unidecode==1.3
- # via python-slugify
-unidecode==1.3.7
- # via python-slugify
-urllib3==2.1.0
- # via requests
-zipp==3.17.0
- # via importlib-metadata
diff --git a/requirements/py3.9/lint.txt b/requirements/py3.9/lint.txt
deleted file mode 100644
index c178f86..0000000
--- a/requirements/py3.9/lint.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.9/lint.txt requirements/lint.in
-#
-astroid==3.0.1
- # via pylint
-dill==0.3.7
- # via pylint
-isort==5.12.0
- # via pylint
-mccabe==0.7.0
- # via pylint
-modernize==0.5
- # via saltpylint
-platformdirs==4.1.0
- # via pylint
-pycodestyle==2.11.1
- # via saltpylint
-pylint==3.0.2
- # via
- # -r requirements/lint.in
- # saltpylint
-saltpylint==2023.8.3
- # via -r requirements/lint.in
-tomli==2.0.1
- # via pylint
-tomlkit==0.12.3
- # via pylint
-typing-extensions==4.8.0
- # via
- # astroid
- # pylint
diff --git a/requirements/py3.9/tests.txt b/requirements/py3.9/tests.txt
deleted file mode 100644
index 89336d5..0000000
--- a/requirements/py3.9/tests.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# This file is autogenerated by pip-compile
-# To update, run:
-#
-# pip-compile --output-file=requirements/py3.9/tests.txt requirements/tests.in
-#
-attrs==23.1.0
- # via
- # pytest-salt-factories
- # pytest-skip-markers
-distlib==0.3.7
- # via virtualenv
-distro==1.8.0
- # via pytest-skip-markers
-exceptiongroup==1.2.0
- # via pytest
-filelock==3.13.1
- # via virtualenv
-iniconfig==2.0.0
- # via pytest
-msgpack==1.0.7
- # via pytest-salt-factories
-packaging==23.2
- # via pytest
-platformdirs==4.1.0
- # via virtualenv
-pluggy==1.3.0
- # via pytest
-psutil==5.9.6
- # via pytest-salt-factories
-pytest-helpers-namespace==2021.12.29
- # via pytest-salt-factories
-pytest-salt-factories==0.912.2
- # via -r requirements/tests.in
-pytest-skip-markers==1.5.0
- # via pytest-salt-factories
-pytest-tempdir==2019.10.12
- # via pytest-salt-factories
-pytest==7.4.3
- # via
- # -r requirements/tests.in
- # pytest-helpers-namespace
- # pytest-salt-factories
- # pytest-skip-markers
- # pytest-tempdir
-pyzmq==25.1.2
- # via pytest-salt-factories
-tomli==2.0.1
- # via pytest
-virtualenv==20.25.0
- # via pytest-salt-factories
diff --git a/requirements/tests.in b/requirements/tests.in
deleted file mode 100644
index 9f29215..0000000
--- a/requirements/tests.in
+++ /dev/null
@@ -1,2 +0,0 @@
-pytest >= 6.1.0
-pytest-salt-factories >= 0.130.0
diff --git a/requirements/tests.txt b/requirements/tests.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 5ca79e7..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,79 +0,0 @@
-[metadata]
-name = saltext.servicenow
-description = Salt Extension for interacting with ServiceNow
-long_description = file: README.md
-long_description_content_type = text/markdown
-author = EITR Technologies
-author_email = devops@eitr.tech
-keywords = salt-extension
-url = https://github.com/salt-extensions/saltext-servicenow
-project_urls =
- Source=https://github.com/salt-extensions/saltext-servicenow
- Tracker=https://github.com/salt-extensions/saltext-servicenow/issues
-license = Apache Software License
-classifiers =
- Programming Language :: Python
- Programming Language :: Cython
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3 :: Only
- Programming Language :: Python :: 3.5
- Programming Language :: Python :: 3.6
- Programming Language :: Python :: 3.7
- Programming Language :: Python :: 3.8
- Programming Language :: Python :: 3.9
- Development Status :: 4 - Beta
- Intended Audience :: Developers
- License :: OSI Approved :: Apache Software License
-platforms = any
-
-[options]
-zip_safe = False
-include_package_data = True
-package_dir =
- =src
-packages = find_namespace:
-python_requires = >= 3.5
-setup_requires =
- wheel
- setuptools>=50.3.2
- setuptools_scm[toml]>=3.4
- setuptools-declarative-requirements
-install_requires =
- salt>=3003
- # Add other module install requirements above this line
-
-[options.packages.find]
-where = src
-exclude =
- tests
-
-# When targetting Salt < 3003, you can remove the other 'options.entry_points' section and use this one
-#[options.entry_points]
-#salt.loader=
-#
-
-[options.entry_points]
-salt.loader=
- saltext.servicenow = saltext.servicenow
-
-[requirements-files]
-install_requires = requirements/base.txt
-tests_require = requirements/tests.txt
-extras_require =
- dev = requirements/dev.txt
- tests = requirements/tests.txt
- docs = requirements/docs.txt
- docsauto = requirements/docs-auto.txt
- changelog = requirements/changelog.txt
-
-[bdist_wheel]
-# Use this option if your package is pure-python
-universal = 1
-
-[build_sphinx]
-source_dir = docs
-build_dir = build/sphinx
-
-[sdist]
-owner = root
-group = root
diff --git a/src/saltext/servicenow/loader.py b/src/saltext/servicenow/loader.py
deleted file mode 100644
index 5d2e0b6..0000000
--- a/src/saltext/servicenow/loader.py
+++ /dev/null
@@ -1,5 +0,0 @@
-"""
-Define the required entry-points functions in order for Salt to know
-what and from where it should load this extension's loaders
-"""
-from . import PACKAGE_ROOT # pylint: disable=unused-import
diff --git a/src/saltext/servicenow/modules/servicenow.py b/src/saltext/servicenow/modules/servicenow.py
index 5ac48ee..d716240 100644
--- a/src/saltext/servicenow/modules/servicenow.py
+++ b/src/saltext/servicenow/modules/servicenow.py
@@ -18,7 +18,6 @@
username: ''
password: ''
"""
-
import logging
HAS_LIBS = False
@@ -112,8 +111,6 @@ def delete_record(table, sys_id):
def non_structured_query(table, query=None, **kwargs):
"""
Run a non-structed (not a dict) query on a servicenow table.
- See http://wiki.servicenow.com/index.php?title=Encoded_Query_Strings#gsc.tab=0
- for help on constructing a non-structured query string.
:param table: The table name, e.g. sys_user
:type table: ``str``
@@ -130,14 +127,11 @@ def non_structured_query(table, query=None, **kwargs):
"""
client = _get_client()
client.table = table
- # underlying lib doesn't use six or past.basestring,
- # does isinstance(x, str)
- # http://bit.ly/1VkMmpE
if query is None:
# try and assemble a query by keyword
query_parts = []
for key, value in kwargs.items():
- query_parts.append("{}={}".format(key, value))
+ query_parts.append(f"{key}={value}")
query = "^".join(query_parts)
query = str(query)
response = client.get(query)
diff --git a/requirements/changelog.txt b/tests/functional/__init__.py
similarity index 100%
rename from requirements/changelog.txt
rename to tests/functional/__init__.py
diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py
new file mode 100644
index 0000000..2c7c84a
--- /dev/null
+++ b/tests/functional/conftest.py
@@ -0,0 +1,150 @@
+import logging
+import shutil
+
+import pytest
+from saltfactories.utils.functional import Loaders
+
+log = logging.getLogger(__name__)
+
+
+@pytest.fixture(scope="package")
+def minion_id():
+ return "func-tests-minion-opts"
+
+
+@pytest.fixture(scope="module")
+def state_tree(tmp_path_factory):
+ state_tree_path = tmp_path_factory.mktemp("state-tree-base")
+ try:
+ yield state_tree_path
+ finally:
+ shutil.rmtree(str(state_tree_path), ignore_errors=True)
+
+
+@pytest.fixture(scope="module")
+def state_tree_prod(tmp_path_factory):
+ state_tree_path = tmp_path_factory.mktemp("state-tree-prod")
+ try:
+ yield state_tree_path
+ finally:
+ shutil.rmtree(str(state_tree_path), ignore_errors=True)
+
+
+@pytest.fixture(scope="module")
+def minion_config_defaults():
+ """
+ Functional test modules can provide this fixture to tweak the default
+ configuration dictionary passed to the minion factory
+ """
+ return {}
+
+
+@pytest.fixture(scope="module")
+def minion_config_overrides():
+ """
+ Functional test modules can provide this fixture to tweak the configuration
+ overrides dictionary passed to the minion factory
+ """
+ return {}
+
+
+@pytest.fixture(scope="module")
+def minion_opts(
+ salt_factories,
+ minion_id,
+ state_tree,
+ state_tree_prod,
+ minion_config_defaults,
+ minion_config_overrides,
+):
+ minion_config_overrides.update(
+ {
+ "file_client": "local",
+ "file_roots": {
+ "base": [
+ str(state_tree),
+ ],
+ "prod": [
+ str(state_tree_prod),
+ ],
+ },
+ }
+ )
+ factory = salt_factories.salt_minion_daemon(
+ minion_id,
+ defaults=minion_config_defaults or None,
+ overrides=minion_config_overrides,
+ )
+ return factory.config.copy()
+
+
+@pytest.fixture(scope="module")
+def master_config_defaults():
+ """
+ Functional test modules can provide this fixture to tweak the default
+ configuration dictionary passed to the master factory
+ """
+ return {}
+
+
+@pytest.fixture(scope="module")
+def master_config_overrides():
+ """
+ Functional test modules can provide this fixture to tweak the configuration
+ overrides dictionary passed to the master factory
+ """
+ return {}
+
+
+@pytest.fixture(scope="module")
+def master_opts(
+ salt_factories,
+ state_tree,
+ state_tree_prod,
+ master_config_defaults,
+ master_config_overrides,
+):
+ master_config_overrides.update(
+ {
+ "file_client": "local",
+ "file_roots": {
+ "base": [
+ str(state_tree),
+ ],
+ "prod": [
+ str(state_tree_prod),
+ ],
+ },
+ }
+ )
+ factory = salt_factories.salt_master_daemon(
+ "func-tests-master-opts",
+ defaults=master_config_defaults or None,
+ overrides=master_config_overrides,
+ )
+ return factory.config.copy()
+
+
+@pytest.fixture(scope="module")
+def loaders(minion_opts):
+ return Loaders(minion_opts, loaded_base_name=f"{__name__}.loaded")
+
+
+@pytest.fixture(autouse=True)
+def reset_loaders_state(loaders):
+ try:
+ # Run the tests
+ yield
+ finally:
+ # Reset the loaders state
+ loaders.reset_state()
+
+
+@pytest.fixture(scope="module")
+def modules(loaders):
+ return loaders.modules
+
+
+@pytest.fixture(scope="module")
+def states(loaders):
+ return loaders.states
diff --git a/requirements/dev.txt b/tests/functional/modules/__init__.py
similarity index 100%
rename from requirements/dev.txt
rename to tests/functional/modules/__init__.py
diff --git a/requirements/docs-auto.txt b/tests/integration/modules/__init__.py
similarity index 100%
rename from requirements/docs-auto.txt
rename to tests/integration/modules/__init__.py
diff --git a/requirements/docs.txt b/tests/integration/states/__init__.py
similarity index 100%
rename from requirements/docs.txt
rename to tests/integration/states/__init__.py
diff --git a/tests/pytests/integration/conftest.py b/tests/pytests/integration/conftest.py
index de99d98..ed1c25a 100644
--- a/tests/pytests/integration/conftest.py
+++ b/tests/pytests/integration/conftest.py
@@ -4,7 +4,6 @@
PyTest fixtures
"""
-
import logging
import pytest
diff --git a/tests/pytests/unit/conftest.py b/tests/pytests/unit/conftest.py
index 5283510..0f68795 100644
--- a/tests/pytests/unit/conftest.py
+++ b/tests/pytests/unit/conftest.py
@@ -1,10 +1,10 @@
import asyncio
+from unittest.mock import MagicMock
+from unittest.mock import patch
import pytest
-
import salt.config
import salt.transport.tcp
-from tests.support.mock import MagicMock, patch
@pytest.fixture
diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py
new file mode 100644
index 0000000..3e3fa4a
--- /dev/null
+++ b/tests/unit/conftest.py
@@ -0,0 +1,57 @@
+import pytest
+import salt.config
+
+
+@pytest.fixture
+def minion_opts(tmp_path):
+ """
+ Default minion configuration with relative temporary paths to not
+ require root permissions.
+ """
+ root_dir = tmp_path / "minion"
+ opts = salt.config.DEFAULT_MINION_OPTS.copy()
+ opts["__role"] = "minion"
+ opts["root_dir"] = str(root_dir)
+ for name in ("cachedir", "pki_dir", "sock_dir", "conf_dir"):
+ dirpath = root_dir / name
+ dirpath.mkdir(parents=True)
+ opts[name] = str(dirpath)
+ opts["log_file"] = "logs/minion.log"
+ return opts
+
+
+@pytest.fixture
+def master_opts(tmp_path):
+ """
+ Default master configuration with relative temporary paths to not
+ require root permissions.
+ """
+ root_dir = tmp_path / "master"
+ opts = salt.config.master_config(None)
+ opts["__role"] = "master"
+ opts["root_dir"] = str(root_dir)
+ for name in ("cachedir", "pki_dir", "sock_dir", "conf_dir"):
+ dirpath = root_dir / name
+ dirpath.mkdir(parents=True)
+ opts[name] = str(dirpath)
+ opts["log_file"] = "logs/master.log"
+ return opts
+
+
+@pytest.fixture
+def syndic_opts(tmp_path):
+ """
+ Default master configuration with relative temporary paths to not
+ require root permissions.
+ """
+ root_dir = tmp_path / "syndic"
+ opts = salt.config.DEFAULT_MINION_OPTS.copy()
+ opts["syndic_master"] = "127.0.0.1"
+ opts["__role"] = "minion"
+ opts["root_dir"] = str(root_dir)
+ for name in ("cachedir", "pki_dir", "sock_dir", "conf_dir"):
+ dirpath = root_dir / name
+ dirpath.mkdir(parents=True)
+ opts[name] = str(dirpath)
+ opts["log_file"] = "logs/syndic.log"
+ return opts
diff --git a/tests/unit/modules/test_servicenow.py b/tests/unit/modules/test_servicenow.py
index 4cb004d..887620f 100644
--- a/tests/unit/modules/test_servicenow.py
+++ b/tests/unit/modules/test_servicenow.py
@@ -1,12 +1,10 @@
"""
:codeauthor: Anthony Shaw
"""
+from unittest.mock import MagicMock
-
+import pytest
import salt.modules.servicenow as servicenow
-from tests.support.mixins import LoaderModuleMockMixin
-from tests.support.mock import MagicMock
-from tests.support.unit import TestCase
class MockServiceNowClient:
@@ -17,44 +15,46 @@ def get(self, query):
return [{"query_size": len(query), "query_value": query}]
-class ServiceNowModuleTestCase(TestCase, LoaderModuleMockMixin):
- def setup_loader_modules(self):
- module_globals = {
- "Client": MockServiceNowClient,
- "__salt__": {
- "config.option": MagicMock(
- return_value={
- "instance_name": "test",
- "username": "mr_test",
- "password": "test123",
- }
- )
- },
- }
- if servicenow.HAS_LIBS is False:
- module_globals["sys.modules"] = {"servicenow_rest": MagicMock()}
- module_globals["sys.modules"][
- "servicenow_rest"
- ].api.Client = MockServiceNowClient
- return {servicenow: module_globals}
-
- def test_module_creation(self):
- client = servicenow._get_client()
- self.assertFalse(client is None)
-
- def test_non_structured_query(self):
- result = servicenow.non_structured_query("tests", "role=web")
- self.assertFalse(result is None)
- self.assertEqual(result[0]["query_size"], 8)
- self.assertEqual(result[0]["query_value"], "role=web")
-
- def test_non_structured_query_kwarg(self):
- result = servicenow.non_structured_query("tests", role="web")
- self.assertFalse(result is None)
- self.assertEqual(result[0]["query_size"], 8)
- self.assertEqual(result[0]["query_value"], "role=web")
-
- def test_non_structured_query_kwarg_multi(self):
- result = servicenow.non_structured_query("tests", role="web", type="computer")
- self.assertFalse(result is None)
- self.assertEqual(result[0]["query_size"], 22)
+@pytest.fixture
+def configure_loader_modules():
+ module_globals = {
+ "Client": MockServiceNowClient,
+ "__salt__": {
+ "config.option": MagicMock(
+ return_value={
+ "instance_name": "test",
+ "username": "mr_test",
+ "password": "test123",
+ }
+ )
+ },
+ }
+ if servicenow.HAS_LIBS is False:
+ module_globals["sys.modules"] = {"servicenow_rest": MagicMock()}
+ module_globals["sys.modules"]["servicenow_rest"].api.Client = MockServiceNowClient
+ return {servicenow: module_globals}
+
+
+def test_module_creation():
+ client = servicenow._get_client()
+ assert not client is None
+
+
+def test_non_structured_query():
+ result = servicenow.non_structured_query("tests", "role=web")
+ assert not result is None
+ assert result[0]["query_size"] == 8
+ assert result[0]["query_value"] == "role=web"
+
+
+def test_non_structured_query_kwarg():
+ result = servicenow.non_structured_query("tests", role="web")
+ assert not result is None
+ assert result[0]["query_size"] == 8
+ assert result[0]["query_value"] == "role=web"
+
+
+def test_non_structured_query_kwarg_multi():
+ result = servicenow.non_structured_query("tests", role="web", type="computer")
+ assert not result is None
+ assert result[0]["query_size"] == 22