Skip to content

Commit

Permalink
Merge branch 'pycontribs:main' into wojtini_fix_get_issue_customfields
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojtini committed Sep 2, 2024
2 parents 8ad5bc6 + 9900396 commit b10d222
Show file tree
Hide file tree
Showing 35 changed files with 759 additions and 399 deletions.
2 changes: 2 additions & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CAs
assertIn
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @pycontribs/jira
/.github/ @ssbarnea
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ body:
attributes:
label: Python Interpreter version
description: The version(s) of Python used.
placeholder: "3.8"
placeholder: "3.9"
validations:
required: true
- type: checkboxes
Expand Down
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# see https://github.com/ansible-community/devtools
_extends: ansible-community/devtools
# see https://github.com/ansible/team-devtools
_extends: ansible/team-devtools
4 changes: 2 additions & 2 deletions .github/workflows/ack.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/ack.yml
name: ack
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
ack:
uses: ansible-community/devtools/.github/workflows/ack.yml@main
uses: ansible/team-devtools/.github/workflows/ack.yml@main
15 changes: 7 additions & 8 deletions .github/workflows/jira_ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: ci

# runs only after tox workflow finished successfully
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
workflow_run:
workflows: [tox]
branches: [main]
types:
- completed

jobs:
server:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: pycontribs/jira/.github/workflows/jira_server_ci.yml@main

cloud:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jira_cloud_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
os: [ubuntu-latest]
# We only test a single version to prevent concurrent
# running of tests influencing one another
python-version: ["3.8"]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4
Expand All @@ -41,7 +41,7 @@ jobs:
python -m pip install --upgrade tox tox-gh-actions
- name: Test with tox
run: tox -e py38 -- -m allow_on_cloud
run: tox -e py39 -- -m allow_on_cloud
env:
CI_JIRA_TYPE: CLOUD
CI_JIRA_CLOUD_ADMIN: ${{ secrets.CLOUD_ADMIN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jira_server_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
jira-version: [8.17.1]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/push.yml
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/push.yml
name: push
on:
push:
Expand All @@ -9,4 +9,4 @@ on:

jobs:
ack:
uses: ansible-community/devtools/.github/workflows/push.yml@main
uses: ansible/team-devtools/.github/workflows/push.yml@main
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
TOX_PARALLEL_NO_SPINNER: 1

steps:
- name: Switch to using Python 3.8 by default
- name: Switch to using Python 3.9 by default
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: Install build dependencies
run: python3 -m pip install --user tox
Expand Down
197 changes: 197 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
name: tox
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
FORCE_COLOR: 1 # tox, pytest
PY_COLORS: 1

jobs:
prepare:
name: prepare
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: Determine matrix
id: generate_matrix
uses: coactions/dynamic-matrix@v3
with:
min_python: "3.9"
max_python: "3.12"
default_python: "3.9"
other_names: |
lint
docs
pkg
py39:tox -e py39 --notest
py310:tox -e py310 --notest
py311:tox -e py311 --notest
py312:tox -e py312 --notest
py39-macos:tox -e py312 --notest
py312-macos:tox -e py312 --notest
# ^ macos is also used to validate arm64 building
platforms: linux,macos
skip_explode: "1"
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
needs:
- prepare
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
steps:

- name: Install package dependencies (ubuntu)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt remove -y docker-compose
sudo apt-get update -y
sudo apt-get --assume-yes --no-install-recommends install -y apt-transport-https curl libkrb5-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed by setuptools-scm
submodules: true

- name: Set pre-commit cache
uses: actions/cache@v4
if: ${{ contains(matrix.name, 'lint') }}
with:
path: |
~/.cache/pre-commit
key: pre-commit-${{ matrix.name }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up Python ${{ matrix.python_version || '3.10' }}
uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python_version || '3.10' }}
cache-dependency-path: "*requirements*.txt"

- name: Install tox
run: |
python3 -m pip install --upgrade pip wheel tox
- run: ${{ matrix.command }}

- run: ${{ matrix.command2 }}
if: ${{ matrix.command2 }}

- run: ${{ matrix.command3 }}
if: ${{ matrix.command3 }}

- run: ${{ matrix.command4 }}
if: ${{ matrix.command4 }}

- run: ${{ matrix.command5 }}
if: ${{ matrix.command5 }}

- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.name }}.zip
if-no-files-found: error
path: |
.tox/**/log/
.tox/**/coverage.xml
- name: Report failure if git reports dirty status
run: |
if [[ -n $(git status -s) ]]; then
# shellcheck disable=SC2016
echo -n '::error file=git-status::'
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
exit 99
fi
# https://github.com/actions/toolkit/issues/193
check:
if: always()
environment: check
permissions:
id-token: write
checks: read

needs:
- build

runs-on: ubuntu-24.04

steps:
# checkout needed for codecov action which needs codecov.yml file
- uses: actions/checkout@v4

- name: Set up Python # likely needed for coverage
uses: actions/setup-python@v5
with:
python-version: "3.12"

- run: pip3 install 'coverage>=7.5.1'

- name: Merge logs into a single archive
uses: actions/upload-artifact/merge@v4
with:
name: logs.zip
pattern: logs-*.zip
# artifacts like py312.zip and py312-macos do have overlapping files
separate-directories: true

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: logs.zip
path: .

- name: Check for expected number of coverage.xml reports
run: |
JOBS_PRODUCING_COVERAGE=0
if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then
echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)"
exit 1
fi
# Single uploads inside check job for codecov to allow use to retry
# it when it fails without running tests again. Fails often enough!
- name: Upload junit xml reports
# PRs from forks might not have access to the secret
if: env.CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN || env.CODECOV_TOKEN }}
uses: codecov/test-results-action@v1
with:
name: ${{ matrix.name }}
files: "*/tests/output/junit/*.xml"
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage data
uses: codecov/codecov-action@v4
with:
name: ${{ matrix.name }}
# verbose: true # optional (default = false)
fail_ci_if_error: false
use_oidc: true # cspell:ignore oidc
files: "*/tests/output/reports/coverage.xml"

# - name: Check codecov.io status
# if: github.event_name == 'pull_request'
# uses: coactions/codecov-status@main

- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

- name: Delete Merged Artifacts
uses: actions/upload-artifact/merge@v4
with:
delete-merged: true
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -15,7 +15,7 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
name: codespell
Expand All @@ -25,9 +25,10 @@ repos:
types: [text]
args: []
require_serial: false
additional_dependencies: []
additional_dependencies:
- tomli; python_version<'3.11'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.4"
rev: "v0.6.3"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -39,11 +40,8 @@ repos:
- id: yamllint
files: \.(yaml|yml)$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies:
- types-requests
- types-pkg_resources
args:
[--no-strict-optional, --ignore-missing-imports, --show-error-codes]
12 changes: 1 addition & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,16 @@ Jira Python Library
.. image:: https://img.shields.io/github/issues/pycontribs/jira.svg
:target: https://github.com/pycontribs/jira/issues

.. image:: https://img.shields.io/badge/irc-%23pycontribs-blue
:target: irc:///#pycontribs

------------

.. image:: https://readthedocs.org/projects/jira/badge/?version=main
:target: https://jira.readthedocs.io/

.. image:: https://codecov.io/gh/pycontribs/jira/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pycontribs/jira

.. image:: https://img.shields.io/bountysource/team/pycontribs/activity.svg
:target: https://www.bountysource.com/teams/pycontribs/issues?tracker_ids=3650997


This library eases the use of the Jira REST API from Python and it has been used in production for years.

As this is an open-source project that is community maintained, do not be surprised if some bugs or features are not implemented quickly enough. You are always welcomed to use BountySource_ to motivate others to help.

.. _BountySource: https://www.bountysource.com/teams/pycontribs/issues?tracker_ids=3650997
As this is an open-source project that is community maintained, do not be surprised if some bugs or features are not implemented quickly enough.


Quickstart
Expand Down
2 changes: 2 additions & 0 deletions bindep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# gssapi pypi wheel build needs:
libkrb5-dev [platform:dpkg]
Loading

0 comments on commit b10d222

Please sign in to comment.