{"id":20784143,"url":"https://github.com/tox-dev/azure-pipelines-template","last_synced_at":"2025-05-11T11:36:00.228Z","repository":{"id":34876574,"uuid":"183435962","full_name":"tox-dev/azure-pipelines-template","owner":"tox-dev","description":"template for your azure pipelines","archived":true,"fork":false,"pushed_at":"2024-10-07T17:04:49.000Z","size":53,"stargazers_count":24,"open_issues_count":2,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T05:43:55.642Z","etag":null,"topics":["azure","azure-pipelines","ci","python","template","testing","tox"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tox-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-25T13:04:26.000Z","updated_at":"2024-10-07T18:47:02.000Z","dependencies_parsed_at":"2023-01-15T09:49:20.017Z","dependency_job_id":null,"html_url":"https://github.com/tox-dev/azure-pipelines-template","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fazure-pipelines-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fazure-pipelines-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fazure-pipelines-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fazure-pipelines-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tox-dev","download_url":"https://codeload.github.com/tox-dev/azure-pipelines-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253560277,"owners_count":21927749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-pipelines","ci","python","template","testing","tox"],"created_at":"2024-11-17T14:26:29.256Z","updated_at":"2025-05-11T11:35:59.969Z","avatar_url":"https://github.com/tox-dev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# tox azure-pipeline-template\n\n[![Build Status](https://dev.azure.com/toxdev/azure-pipelines-template/_apis/build/status/tox-dev.azure-pipelines-template?branchName=master)](https://dev.azure.com/toxdev/azure-pipelines-template/_build/latest?definitionId=11\u0026branchName=master)\n\nThis a template that will help simplify the\n[Azure Pipelines](https://azure.microsoft.com/en-gb/services/devops/pipelines/) configuration when using\n[tox](https://tox.readthedocs.org) to drive your CI.\n\n# usage\n\n**First configure a github service connection**\n\nIt is suggested to use a generic name, such as `github` so forks can also configure the same.\n\nYou can find this in `Project Settings` =\u003e `Service connections` in the Azure Devops dashboard for your project. Project\nsettings is located in the bottom left corner of the UI as of 2019-04-30. Below I'm using the endpoint name `github`.\n\n**To load the template, add this to the beginning of the `azure-pipelines.yml`**\n\n```yaml\nresources:\n  repositories:\n    - repository: tox\n      type: github\n      endpoint: github\n      name: tox-dev/azure-pipelines-template\n      ref: refs/tags/0.2\n```\n\nthis will make the templates in this repository available in the `tox` namespace. Note the ref allows you to pin the\ntemplate version you want, you can use `refs/master` if you want latest unstable version.\n\n# job templates\n\n## `run-tox-env.yml`\n\n#### Assumptions\n\ntox will run under `Python 3.8`. tox environments generate Junit file under `.tox\\junit.{toxenv}.xml`. Environments\ntracking coverage data generate will have another tox environment to normalize/merge coverage files. These should be\ninvoked after test suit runs, and one final time to merge all the sub-coverage files when all specified tox environments\nfinished (independent their outcome).\n\n### Logic\n\nThis job template will run tox for a given set of tox target on given platforms (new in `0.2`). Features and\nfunctionality:\n\n- each specified toxenv target maps to a single Azure Pipelines job, but split over multiple architectures via the image\n  matrix (each matrix will set the `image_name` variable to `macOs`, `linux` or `windows` depending on the image used)\n- make tox available in the job: provision a python (`3.8`) and install a specified tox into that\n- provision a python needed for the target tox environment\n- provision the target tox environment (create environment, install dependencies)\n- invoke the tox target\n- if a junit file is found under `.tox\\junit.{toxenv}.xml` upload it as test report\n- if coverage is requested, run a tox target that should generate the `.tox\\coverage.xml` or `.tox\\.coverage` and upload\n  those as a build artifact (also enqueue a job after all these job succeed to merge the generated coverage reports)\n- if coverage was requested queue a job that post all toxenv runs will merge all the coverages via a tox target\n\n### example\n\nThe following example will run `py36` and `py37` on Windows, Linux and MacOs. It will also invoke `fix_lint` and `docs`\ntarget with `python3.8` on Linux. It will also run the the `coverage` tox environment for `py37` and `py36`, and then\nsave as build artifacts files `.tox/.coverage` and `.tox/coverage.xml`:\n\n```yaml\njobs:\n  - template: run-tox-env.yml@tox\n    parameters:\n      tox_version: \"\"\n      jobs:\n        fix_lint: null\n        docs: null\n        py37:\n          image: [linux, windows, macOs]\n        py36:\n          image: [linux, windows, macOs]\n      coverage:\n        with_toxenv: \"coverage\"\n        for_envs: [py39, py38]\n```\n\n### parameters\n\nAt root level you can control with:\n\n- `tox_version` the tox version specifier to install, this defaults to latest in PyPi (`tox`) - setting it to empty,\n- `dependsOn` jobs these set of jobs should depend on\n- `before` steps to be run before invoking every tox environment (useful to provision additional dependencies), use\n  condition variables for architecture specific content\n- `jobs` a map where the key is the tox environment key, while the value is configuration related to that environment:\n\n  - the key determines the tox target to run\n  - the value contains:\n\n    - `image` to list an array of targeted architecture, the array elements are mapped as:\n\n      - `linux` - `ubuntu-latest`\n      - `windows` - `windows-latest`\n      - `osx` - `macOS-latest`\n      - otherwise the value if set, fallback to `ubuntu-latest`.\n\n    - `py` - determines the python to provision for running the environment, if not set will be derived from the key:\n      - `py27` or starts with `py27-` - Python 2.7\n      - `py36` or starts with `py36-` - Python 3.6\n      - `py37` or starts with `py37-` - Python 3.7\n      - `py38` or starts with `py38-` - Python 3.8\n      - `py39` or starts with `py39-` - Python 3.9\n      - `py310` or starts with `py310-` - Python 3.10\n      - `pypy` or starts with `pypy-` - PyPy 2\n      - `pypy3` or starts with `pypy3-` - PyPy 3\n      - `jython` - Jython is available from under Linux and MacOs.\n    - `architecture`: Python architecture (either `x64` or `x86`) with default `x64` (only affects windows)\n    - `before` steps to be run before invoking this tox environment (useful to provision additional dependencies)\n\n- `coverage` - if set runs a tox environment (`with_toxenv` - must run with `python3.8`) to normalize coverage data\n  (must generate `.tox/.coverage` and `.tox/coverage.xml`) after all environments within `for_envs`. It also enqueues a\n  final job to use `with_toxenv` to merge the coverage files under the name `report_coverage`.\n\n## `publish-pypi.yml`\n\n#### Assumptions\n\nThe project is PEP-517 and PEP-518 compatible. A PyPi remote and external feed is configured via Azure Pipelines project\ndashboard.\n\n### Logic\n\nThis job template will publish the Python package in the current folder (both sdist and wheel) via the PEP-517/8 build\nmechanism and twine.\n\n### example\n\n```yaml\n- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:\n    - template: publish-pypi.yml@tox\n      parameters:\n        external_feed: \"toxdev\"\n        pypi_remote: \"pypi-toxdev\"\n        dependsOn: [report_coverage, fix_lint, docs]\n```\n\n### parameters\n\n- `external_feed` - the external feed to upload\n- `pypi_remote` - the pypi remote to upload to\n- `dependsOn` - jobs this jobs depends on\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftox-dev%2Fazure-pipelines-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftox-dev%2Fazure-pipelines-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftox-dev%2Fazure-pipelines-template/lists"}