Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 21 additions & 29 deletions .github/workflows/main_pr_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,32 @@ permissions:
contents: read

jobs:
setup-env:
runs-on: ubuntu-latest
run-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version:
- "3.9"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With 3.9 being EOL we should remove from the matrix and drop support. Something we already talked about. Doesn't have to be in this PR.

- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
name: Run unit tests
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.9'
cache: 'pip'
run: uv python install ${{ matrix.python-version }}

- name: Install
run: make install
Expand All @@ -33,26 +48,3 @@ jobs:

- name: Tests
run: make test

# exp-integration-tests:
# continue-on-error: true
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.9'
# cache: 'pip'

# - name: Install
# run: make install

# - name: Run Integration Tests
# run: make test-all
# env:
# JAMF_PRO_HOST: ${{ vars.JAMF_PRO_HOST }}
# JAMF_PRO_CLIENT_ID: ${{ vars.JAMF_PRO_CLIENT_ID }}
# JAMF_PRO_CLIENT_SECRET: ${{ vars.JAMF_PRO_CLIENT_SECRET }}
7 changes: 4 additions & 3 deletions .github/workflows/publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ jobs:
with:
ref: ${{ inputs.ref }}

- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: '3.9'
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Build Sphinx Docs
run: |
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/publish_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:
with:
ref: ${{ inputs.ref }}

- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: '3.9'

- name: Install pypa/build
run: python3 -m pip install -U build --user
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Build Package
run: make build
Expand Down
27 changes: 15 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
SHELL := /bin/bash
.PHONY: docs
SHELL := /bin/bash
UV := uv
VENV_DIR := .venv

.PHONY: venv install uninstall clean test test-all lint format build docs

install:
python3 -m pip install --upgrade --force-reinstall --editable '.[dev]'
$(UV) sync --all-extras

uninstall:
python3 -m pip uninstall -y -r <(python3 -m pip freeze)
rm -rf $(VENV_DIR)

clean:
rm -rf build/ dist/ src/*.egg-info **/__pycache__ .coverage .pytest_cache/ .ruff_cache/

test:
pytest tests/unit
$(UV) run pytest tests/unit

test-all:
pytest tests
$(UV) run pytest tests

lint:
ruff format --check src tests
ruff check src tests
$(UV) run ruff format --check src tests
$(UV) run ruff check src tests

format:
ruff format src tests
ruff check --select I001 --fix src tests # Only fixes import order
$(UV) run ruff format src tests
$(UV) run ruff check --select I001 --fix src tests # Only fixes import order

build:
python3 -m build --sdist --wheel
$(UV) build

docs:
rm -f docs/reference/_autosummary/*.rst
sphinx-build -b html docs/ build/docs/
$(UV) run sphinx-build -b html docs/ build/docs/
12 changes: 7 additions & 5 deletions docs/contributors/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,25 @@ Your pull request may not be accepted if it does not fulfill all of the requirem
Dev Environment Setup
^^^^^^^^^^^^^^^^^^^^^

It is recommended you use a Python virtual environment for local development (see `venv <https://docs.python.org/3/library/venv.html>`_.
This project uses `uv <https://docs.astral.sh/uv/>`_ to manage the development environment and dependencies. `Install uv <https://docs.astral.sh/uv/getting-started/installation/>`_ first. You do not need to create or activate a virtual environment yourself, uv manages one for you.

.. tip::

The ``Makefile`` included in the project includes shortcut commands that will be referenced in this document. You must install ``Xcode Command Line Tools`` on macOS to use the ``make`` command.

With your virtual environment active run the following from the SDK repository's directory:
From the SDK repository's directory, run:

.. code-block:: console

(.venv) % make install
% make install

This will install the package in editable mode with all dev and optional dependencies.
This runs ``uv sync --all-extras``, which creates a ``.venv`` and installs the package in editable mode with all dev and optional dependencies, pinned to the versions in ``uv.lock``.

Run project commands through ``make`` (for example ``make test``, ``make lint``, ``make docs``) or directly with ``uv run`` (for example ``uv run pytest``). Both execute inside the managed environment.

There are two additional ``make`` commands for maintaining your local environment.

* ``uninstall`` will remove **ALL** Python packages from your virtual environment allowing you to reinstall cleanly if needed.
* ``uninstall`` removes the ``.venv`` directory so you can reinstall cleanly with ``make install``.
* ``clean`` will remove any directory that's generated by linting, testing, and building the package. This is useful in the event cached files are causing an issue with running commands.

Code Quality
Expand Down
Loading
Loading