diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a71df2ae..fd601444 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,7 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence they # will be requested for review when someone opens a pull request. -* @tektronix/tm-devices-maintainers +* @tektronix/tm-devices-admin # Protect the configuration files .github/ @tektronix/tm-devices-admin diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml new file mode 100644 index 00000000..e420d015 --- /dev/null +++ b/.github/auto_assign.yml @@ -0,0 +1,8 @@ +--- +addReviewers: true +addAssignees: author +reviewers: + - tektronix/tm-devices-maintainers +# Number of reviewers has no impact on GitHub teams +# Set 0 to add all the reviewers (default: 0) +numberOfReviewers: 0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5f4e37fe..94e30626 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -10,7 +10,6 @@ on: - cron: 17 16 * * 4 release: jobs: -# REMEMBER TO CHECK `LANGUAGE` MATRIX FOR CORRECT LANGUAGE SETTINGS analyze: name: Analyze runs-on: ubuntu-latest @@ -22,22 +21,14 @@ jobs: fail-fast: false matrix: language: [python] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - name: Checkout repository uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 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. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + queries: security-extended,security-and-quality - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: diff --git a/.github/workflows/package-build.yml b/.github/workflows/package-build.yml index a80e0c9f..fc9fa1e8 100644 --- a/.github/workflows/package-build.yml +++ b/.github/workflows/package-build.yml @@ -1,5 +1,5 @@ --- -name: Package build & Upload +name: Package Build & Upload on: push: branches: [main] @@ -25,47 +25,50 @@ jobs: with: fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v1.5 -# # Upload to Test PyPI on every push to main -# test-pypi: -# name: Publish package to test.pypi.org -# environment: -# name: test-pypi -# url: https://test.pypi.org/p/tm_devices -# if: github.repository == 'tektronix/tm_devices' && github.event_name == 'push' && github.ref == 'refs/heads/main' -# runs-on: ubuntu-latest -# needs: build-package -# steps: -# - name: Download built package -# uses: actions/download-artifact@v3 -# with: -# name: Package -# path: dist -# - name: Upload package to Test PyPI -# uses: pypa/gh-action-pypi-publish@v1.8.8 -# with: -# repository-url: https://test.pypi.org/legacy/ -# -# # Upload to PyPI and create a tag in the repo after a GitHub Release is published -# pypi: -# name: Publish released package to pypi.org and create new tag in repo -# environment: -# name: pypi -# url: https://pypi.org/p/tm_devices -# if: github.repository == 'tektronix/tm_devices' && github.event.action == 'published' -# runs-on: ubuntu-latest -# needs: build-package -# permissions: -# contents: write -# steps: -# - uses: actions/checkout@v3 -# - name: Download built package -# uses: actions/download-artifact@v3 -# with: -# name: Package -# path: dist -# - name: Upload package to PyPI -# uses: pypa/gh-action-pypi-publish@v1.8.8 -# - name: Create and push tag -# run: |- -# git tag --annotate v${{ github.event.release.tag_name }} --message="${{ github.event.release.name }}" -# git push --tags + + # Upload to Test PyPI on every push to main + test-pypi: + name: Publish package to test.pypi.org + environment: + name: test-pypi + url: https://test.pypi.org/p/tm_devices + if: github.repository == 'tektronix/tm_devices' && github.event_name == 'push' + && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: build-package + steps: + - name: Download built package + uses: actions/download-artifact@v3 + with: + name: Package + path: dist + - name: Upload package to Test PyPI + uses: pypa/gh-action-pypi-publish@v1.8.8 + with: + repository-url: https://test.pypi.org/legacy/ + + # Upload to PyPI and create a tag in the repo after a GitHub Release is published + pypi: + name: Publish released package to pypi.org and create new tag in repo + environment: + name: pypi + url: https://pypi.org/p/tm_devices + if: github.repository == 'tektronix/tm_devices' && github.event_name == 'release' + && github.event.action == 'published' + runs-on: ubuntu-latest + needs: build-package + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - name: Download built package + uses: actions/download-artifact@v3 + with: + name: Package + path: dist + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@v1.8.8 + - name: Create and push tag + run: |- + git tag --annotate v${{ github.event.release.tag_name }} --message="${{ github.event.release.name }}" + git push --tags diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index b30ee019..5f48e9fb 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-latest, windows-latest] # TODO: add "macos-latest" back to the platform list + platform: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 @@ -44,7 +44,7 @@ jobs: strategy: fail-fast: false matrix: - os_name: [ubuntu, windows] # TODO: add "macos" back to the os_name list + os_name: [ubuntu, windows, macos] steps: - uses: actions/checkout@v3 - name: Set up Python @@ -64,12 +64,12 @@ jobs: name: artifact_${{ matrix.os_name }}_tests path: .results_*/** # TODO: look into using https://github.com/mikepenz/action-junit-report for a junit report -# - name: Upload coverage to Codecov -# uses: codecov/codecov-action@v3 -# with: -# files: ./.coverage.tests -# name: codecov-${{ matrix.os_name }} -# fail_ci_if_error: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./.coverage.tests + name: codecov-${{ matrix.os_name }} + fail_ci_if_error: true # Check that all jobs passed check-tests-passed: if: always() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72d135a6..2c748d4b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,13 @@ default_stages: [pre-commit] ci: autofix_prs: false autoupdate_schedule: quarterly + skip: + - check-poetry + - toml-sort + - pylint + - pyright + - pyright-verifytypes + - pyroma repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 @@ -34,7 +41,7 @@ repos: - id: check-github-actions - id: check-github-workflows - repo: https://github.com/commitizen-tools/commitizen - rev: 3.7.0 + rev: 3.9.0 hooks: - id: commitizen stages: [commit-msg] @@ -114,12 +121,12 @@ repos: always_run: true args: [., --min=10] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.287 + rev: v0.0.290 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black - repo: https://github.com/PyCQA/docformatter diff --git a/README.md b/README.md index 8e4103c4..fdb73482 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/src/tm_devices/__init__.py b/src/tm_devices/__init__.py
index 45ab0fc9..f18ca098 100644
--- a/src/tm_devices/__init__.py
+++ b/src/tm_devices/__init__.py
@@ -4,12 +4,11 @@
Examples:
>>> from tm_devices import DeviceManager
- >>> with DeviceManager() as dm: # doctest: +ELLIPSIS
+ >>> with DeviceManager() as dm: # doctest: +SKIP
... print(dm.is_open)
- 2... - Opening DeviceManager
+ 2023-09-21 01:50:16.031 - Opening DeviceManager
True
-