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
85 changes: 83 additions & 2 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,83 @@
CAs
assertIn
Contribs
Greenhopper
Navicat
PYJIRA
Sbarnea
Sorin
Speakmon
actornames
addono
addopts
applicationlink
applinks
backupmanager
caplog
capsys
codespell
docstrings
duedate
faceplants
favourite
fielddict
fieldtypes
findfile
getprogress
googlicious
hashify
headingcolour
igrid
incompleted
inwardissue
issuekey
issuelinks
issuesecuritylevelscheme
issuetype
jiraerror
jirashell
jspa
kall
labelarray
libkrb
libmagic
loggedin
minversion
multipartencoded
mypermissions
notauser
notificationschemes
outwardissue
perc
pincomments
prek
proja
projb
projectcategories
projectkey
projectkeys
pyupgrade
reindexing
requesttype
resilientsession
rndpassword
rndstr
rolesdict
rsyncdirs
rsyncignore
runbackup
serialised
sprintreport
ssbarnea
statuscategorychangedate
statuscode
stoptheworld
testpaths
tombi
tomlsort
toolbelt
transitionid
unclobbered
viewissue
webdav
woopsydoodle
workflowschemes
xdist
6 changes: 2 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ updates:
day: sunday
interval: weekly
labels:
- dependabot-deps-updates
- skip-changelog
- chore
groups:
dependencies:
patterns:
Expand All @@ -17,5 +16,4 @@ updates:
schedule:
interval: daily
labels:
- "dependencies"
- "skip-changelog"
- chore
94 changes: 35 additions & 59 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,91 +1,67 @@
---
ci:
# We rely on renovate to update it but there is no way to fully disable it
# https://github.com/pre-commit-ci/issues/issues/83
autoupdate_schedule: quarterly
skip:
- pip-compile
- cspell # missing uv
- codecov # missing uv
- shellcheck # no docker support on pre-commit.ci
# uv not present on pre-commit.ci
- mypy
- pylint
- ruff
- toml
repos:
- repo: meta
hooks:
- id: check-useless-excludes
priority: 0
- repo: https://github.com/ansible/actions
rev: v1.0.1
hooks:
- id: toml
priority: 0
- id: mypy
priority: 2
- id: ruff
priority: 1
- id: cspell
priority: 0
# - id: pylint
# priority: 5
- id: codecov
priority: 0
- id: codespell
priority: 0
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v6.0.0
hooks:
- id: check-added-large-files
priority: 0
- id: check-merge-conflict
priority: 0
- id: check-symlinks
priority: 0
- id: debug-statements
priority: 0
- id: end-of-file-fixer
priority: 1
- id: trailing-whitespace
priority: 1
- id: mixed-line-ending
- id: fix-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell
language: python
types: [text]
args: []
require_serial: false
additional_dependencies:
- tomli; python_version<'3.11'
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.2
hooks:
- id: toml-sort-fix
alias: toml

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.6.0
hooks:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.12
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
types_or: [python, pyi]
# - id: ruff-format # must be after ruff
# types_or: [python, pyi]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
hooks:
- id: mypy
additional_dependencies:
- types-requests
- # keep at bottom as these are slower
repo: local
hooks:
- id: deps
name: Upgrade constraints files and requirements
files: ^(pyproject\.toml|.config/.*)$
always_run: true
language: python
entry: python3 -m uv pip compile -q --universal --all-extras --python-version=3.10 --output-file=.config/constraints.txt pyproject.toml --upgrade
pass_filenames: false
stages:
- manual
additional_dependencies:
- uv>=0.6.6
- id: pip-compile
name: Check constraints files and requirements
files: ^(pyproject\.toml|\.config/.*)$
language: python
entry: uv pip compile -q --universal --all-extras --python-version=3.10 --output-file=.config/constraints.txt pyproject.toml
pass_filenames: false
additional_dependencies:
- uv>=0.6.6
22 changes: 22 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
dictionaryDefinitions:
- name: words
path: .config/dictionary.txt
addWords: true
dictionaries:
- bash
- software-terms
- networking-terms
- makefile
- python
- words
enabled: true
useGitignore: true
ignorePaths:
- tox.ini
- docs/conf.py
- docs/ # temporary
- .venv

languageSettings:
- languageId: python
allowCompoundWords: false
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ content needs to be formatted using the Atlassian Document Format (ADF)::
"type": "codeBlock",
"content": [
{
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
"text": "This some text",
"type": "text"
}
]
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Get an issue.
issue = jira.issue("JRA-1330")
# Find all comments made by Atlassians on this issue.
# Find all comments made by Atlassian on this issue.
atl_comments = [
comment
for comment in issue.fields.comment.comments
Expand Down
18 changes: 12 additions & 6 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def experimental_atlassian_api(client_method: Callable) -> Callable:

Indicates the path covered by the client method is experimental. If the path
disappears or the method becomes disallowed, this logs an error and returns
None. If another kind of exception is raised, this reraises.
None. If another kind of exception is raised, this re-raises.

Raises:
JIRAError: In the case the error is not an HTTP error with a status code.
Expand Down Expand Up @@ -615,7 +615,7 @@ def __init__(
# Add the client authentication certificate to the request if configured
self._add_client_cert_to_session()
# Add the SSL Cert to the request if configured
self._add_ssl_cert_verif_strategy_to_session()
self._add_ssl_cert_verify_strategy_to_session()

self._session.headers.update(self._options["headers"])

Expand Down Expand Up @@ -1610,7 +1610,7 @@ def filter(self, id: str) -> Filter:
return self._find_for_resource(Filter, id)

def favourite_filters(self) -> list[Filter]:
"""Get a list of filter Resources which are the favourites of the currently authenticated user.
"""Get a list of filter Resources which are the favorites of the currently authenticated user.

Returns:
List[Filter]
Expand Down Expand Up @@ -4412,7 +4412,7 @@ def _create_oauth_session(self, oauth: dict[str, Any]):
try:
from oauthlib.oauth1 import SIGNATURE_RSA as FALLBACK_SHA
except ImportError:
FALLBACK_SHA = DEFAULT_SHA
FALLBACK_SHA = DEFAULT_SHA # type: ignore
self.log.debug("Fallback SHA 'SIGNATURE_RSA_SHA1' could not be imported.")

for sha_type in (oauth.get("signature_method"), DEFAULT_SHA, FALLBACK_SHA):
Expand Down Expand Up @@ -4475,7 +4475,7 @@ def _add_client_cert_to_session(self):
client_cert: str | tuple[str, str] = self._options["client_cert"]
self._session.cert = client_cert

def _add_ssl_cert_verif_strategy_to_session(self):
def _add_ssl_cert_verify_strategy_to_session(self):
"""Adds verification strategy for host SSL certificates.

If configured through the constructor.
Expand Down Expand Up @@ -4536,7 +4536,11 @@ def _get_internal_url(self, path: str, base: str = JIRA_BASE_URL) -> str:
"""
options = self._options.copy()
options.update(
{"path": path, "rest_api_version": "latest", "rest_path": "internal"}
{
"path": path,
"rest_api_version": "latest",
"rest_path": "internal",
}
)
return base.format(**options)

Expand Down Expand Up @@ -5445,6 +5449,7 @@ def role(self) -> list[dict[str, Any]]:
data: list[dict[str, Any]] = json_loads(r)
return data

# cspell:ignore idalko
# Experimental support for iDalko Grid, expect API to change as it's using private
# APIs currently https://support.idalko.com/browse/IGRID-1017
def get_igrid(self, issueid: str, customfield: str, schemeid: str):
Expand Down Expand Up @@ -5841,6 +5846,7 @@ def rank(
other_issue = prev_issue

if not self._rank:
# cspell:ignore lexo
for field in self.fields():
if field["name"] == "Rank":
if (
Expand Down
8 changes: 1 addition & 7 deletions jira/jirashell.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,7 @@ def main():
oauth=oauth,
)

import IPython

# The top-level `frontend` package has been deprecated since IPython 1.0.
if IPython.version_info[0] >= 1:
from IPython.terminal.embed import InteractiveShellEmbed
else:
from IPython.frontend.terminal.embed import InteractiveShellEmbed
from IPython.terminal.embed import InteractiveShellEmbed

ip_shell = InteractiveShellEmbed(
banner1="<Jira Shell " + __version__ + " (" + jira.server_url + ")>"
Expand Down
9 changes: 7 additions & 2 deletions jira/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,11 @@ def update( # type: ignore[override] # incompatible supertype ignored
``DashboardGadget``
"""
data = remove_empty_attributes(
{"color": color, "position": position, "title": title}
{
"color": color,
"position": position,
"title": title,
}
)
options = self._options.copy()
options["path"] = f"dashboard/{dashboard_id}/gadget/{self.id}"
Expand Down Expand Up @@ -913,7 +917,7 @@ def delete(self, deleteSubtasks=False):
super().delete(params={"deleteSubtasks": deleteSubtasks})

def permalink(self):
"""Get the URL of the issue, the browsable one not the REST one.
"""Get the URL of the issue, the browser aimed one not the REST one.

Returns:
str: URL of the issue
Expand Down Expand Up @@ -1322,6 +1326,7 @@ def update( # type: ignore[override]

data = {
"id": self.id,
# cspell:ignore categorisedactors
"categorisedActors": {
"atlassian-user-role-actor": users,
"atlassian-group-role-actor": groups,
Expand Down
Loading
Loading