diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ecc81e2..1feceb7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,16 +42,19 @@ jobs: - name: Pre Commit Checks uses: pre-commit/action@v3.0.1 + - name: Set up uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Setup Temp Directory run: mkdir broker_dir - name: Unit Tests env: BROKER_DIRECTORY: "${{ github.workspace }}/broker_dir" + UV_SYSTEM_PYTHON: 1 run: | cp broker_settings.yaml.example ${BROKER_DIRECTORY}/broker_settings.yaml - pip install uv - uv pip install --system "broker[dev,docker] @ ." + uv pip install "broker[dev,docker] @ ." ls -l "$BROKER_DIRECTORY" broker --version pytest -v tests/ --ignore tests/functional diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index e69e3cb..30a5053 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -22,9 +22,13 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Set up uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Setup and Build + env: + UV_SYSTEM_PYTHON: 1 run: | - pip install uv uv pip install --system "broker[setup] @ ." python -m build python -m twine check dist/* diff --git a/README.md b/README.md index e8a8c33..dc91e94 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,24 @@ Broker's docs can be found at the wiki for this repo: https://github.com/Satelli # Quickstart Install cmake with `dnf install cmake` -Install Broker either by cloning locally with `pip install .` or with `pip install broker` for the latest version from PyPI. +**Note:** We recommend using [uv](https://github.com/astral-sh/uv?tab=readme-ov-file#installation) to manage your Broker installation. -Copy the example settings file to `broker_settings.yaml` and edit it. +Install Broker either as a tool with uv `uv tool install broker` -(optional) If you are using the Container provider, install the extra dependency based on your container runtime of choice with either `pip install broker[podman]` or `pip install broker[docker]`. +or with pip `pip install broker` -(optional) If you are using the Beaker provider, install the extra dependency with `dnf install krb5-devel` and then `pip install broker[beaker]`. +**Note:** If you install with pip it is recommended that you do so in a virtual environment. -To run Broker outside of its base directory, specify the directory with the `BROKER_DIRECTORY` environment variable. +(optional) If you are using the Container provider, install the extra dependency based on your container runtime of choice with either `... install broker[podman]` or `... install broker[docker]`. + +(optional) If you are using the Beaker provider, install the extra dependency with `dnf install krb5-devel` and then `... install broker[beaker]`. -Configure the `broker_settings.yaml` file to set configuration values for broker's interaction with its providers. +The first time you run Broker, like with `broker --version`, it will check if you already have a `broker_settings.yaml` in the location it expects. +If not, then it will help you get one setup and place it in the default broker directory `~/.broker/` + +If you want Broker to operate out of a different location, export a `BROKER_DIRECTORY` environment variable with the desired path. + +You can check `broker --version` at any time to verify where it is looking for its config file. # Basic CLI Usage **Checking out a VM or container** @@ -123,3 +130,12 @@ broker checkout --background --nick rhel7 broker checkin -b --all broker execute -b --workflow my-awesome-workflow --artifacts ``` + +# Development Setup +Install cmake with `dnf install cmake` + +Clone the Broker repository and install locally with `uv pip install "broker[dev] @ ."` + +Copy the example settings file to `broker_settings.yaml` and edit it. + +To run Broker outside of its base directory, specify the directory with the `BROKER_DIRECTORY` environment variable. diff --git a/pyproject.toml b/pyproject.toml index f2103ec..420dff0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ name = "broker" description = "The infrastructure middleman." readme = "README.md" requires-python = ">=3.10" -license = {file = "LICENSE", name = "GNU General Public License v3"} keywords = ["broker", "AnsibleTower", "docker", "podman", "beaker"] authors = [ {name = "Jacob J Callahan", email = "jacob.callahan05@gmail.com"}