diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..6f26ecc --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.13-slim + +# Install UV +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + +# Install git +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && rm -rf /var/lib/apt/lists/* + +# Install Python dependencies +WORKDIR /workspaces/python-wiremock +COPY pyproject.toml uv.lock ./ +ENV UV_PROJECT_ENVIRONMENT=/usr/local +RUN uv sync --frozen \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..270fb99 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +{ + "name": "Python Wiremock", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "overrideCommand": true, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "charliermarsh.ruff" + ] + } + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index f207109..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: [platinummonkey] -custom: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=UV978FNAYLYZE&item_name=Github+Donations¤cy_code=USD&source=url diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index 5289e85..1041573 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -10,20 +10,13 @@ jobs: name: Check Documentation runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v6 with: - python-version: "3.10" - - name: Install Poetry - run: curl -sSL https://install.python-poetry.org | python + python-version: '3.13' + enable-cache: true - name: Install dependencies - run: | - poetry env use '3.10' - poetry install --extras=testing + run: uv sync --locked --group docs - name: Build docs with MkDocs - run: | - make docs - - name: Check Markdown links - uses: gaurav-nelson/github-action-markdown-link-check@v1 + run: make docs \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 0645b7b..342e222 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -13,11 +13,11 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" - - name: Install Poetry - run: curl -sSL https://install.python-poetry.org | python + python-version: "3.13" + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Get version from pyproject.toml - run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV + run: echo "VERSION=$(uv version --short)" >> $GITHUB_ENV - uses: release-drafter/release-drafter@v5 with: name: ${{ env.VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b951c92..bd8d18f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,12 +17,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" - - name: Install Poetry - run: curl -sSL https://install.python-poetry.org | python + python-version: "3.13" + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: poetry install + run: uv sync - name: Build distributions - run: poetry build + run: uv build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 34a32bd..514af63 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,26 +12,25 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install Poetry - run: curl -sSL https://install.python-poetry.org | python + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Install dependencies run: | - poetry env use ${{matrix.python-version}} - poetry install --extras=testing + uv sync --extra testing - name: Test with pytest run: | - poetry run pytest tests/ + uv run pytest tests/ integration-tests: runs-on: ubuntu-latest @@ -42,6 +41,6 @@ jobs: - name: Integration Tests run: | - cd example/ - docker-compose build overview_srv - docker-compose run overview_srv pytest --tb=short + cd examples/intro/ + docker compose build overview_srv + docker compose run overview_srv pytest --tb=short diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 181f3e7..bace288 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,12 +20,10 @@ build: python: "3.11" jobs: post_create_environment: - # Install poetry - # https://python-poetry.org/docs/#installing-manually - - pip install poetry - # Tell poetry to not use a virtual environment - - poetry config virtualenvs.create false + # Install uv + - pip install uv + # Tell uv to not use a virtual environment + - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH post_install: # Install dependencies with 'docs' dependency group - # https://python-poetry.org/docs/managing-dependencies/#dependency-groups - - poetry install --with docs + - uv sync --group docs diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..eaaa2db --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff" + }, + "editor.formatOnSave": true, +} \ No newline at end of file diff --git a/Makefile b/Makefile index 23c761b..a9463c8 100644 --- a/Makefile +++ b/Makefile @@ -44,4 +44,4 @@ clean: find . -name '.bak' -exec rm -f {} + docs: - poetry run mkdocs build --site-dir=html + uv run mkdocs build --site-dir=html diff --git a/README.md b/README.md index 88c853d..c20b6fa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Python WireMock Admin API Client +# Python WireMock

@@ -6,10 +6,24 @@

-Python Wiremock is an HTTP client that allows users to interact with a Wiremock instance from within a Python project. +--- + + + + + +
+WireMock Cloud Logo +WireMock open source is supported by WireMock Cloud. Please consider trying it out if your team needs advanced capabilities such as OpenAPI, dynamic state, data sources and more. +
+ +--- + +Python WireMock is a library that allows users to interact with a WireMock instance from within a Python project. +Full documentation can be found at [wiremock.readthedocs.org](https://wiremock.readthedocs.org/). [![a](https://img.shields.io/badge/slack-%23wiremock%2Fpython-brightgreen?style=flat&logo=slack)](https://slack.wiremock.org/) -[![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://wiremock.readthedocs.org/) +[![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://wiremock.readthedocs.org/)