Skip to content

Commit

Permalink
Drop python-3.7
Browse files Browse the repository at this point in the history
It's been EOL for over a year.

We need typing-extensions' backport of typing.Literal in order to
support python-3.7, which is triggering a problem with intersphinx
in CI. Removing typing-extensions solves the problem.
  • Loading branch information
ryneeverett committed Nov 14, 2024
1 parent e9c7580 commit 7e66aff
Show file tree
Hide file tree
Showing 32 changed files with 67 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bugwarrior.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
timeout-minutes: 5
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]
python-version: [3.8, 3.9, "3.10", 3.11]
jira-version: [1.0.10, 2.0.0]
steps:
- name: Checkout code
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]
python-version: [3.8, 3.9, "3.10", 3.11]
jira-version: [1.0.10, 2.0.0]
architecture: [aarch64, ppc64le]

Expand Down
7 changes: 3 additions & 4 deletions bugwarrior/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pydantic.v1
import pydantic.v1.error_wrappers
import taskw
import typing_extensions

from bugwarrior.collect import get_service

Expand Down Expand Up @@ -139,7 +138,7 @@ def compute_data(cls, values):
static_tags: ConfigList = ConfigList([])
static_fields: ConfigList = ConfigList(['priority'])

log_level: typing_extensions.Literal[
log_level: typing.Literal[
('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'DISABLED')
] = 'INFO'
log_file: typing.Optional[LoggingPath] = None
Expand All @@ -152,7 +151,7 @@ class Hooks(pydantic.v1.BaseModel):
class Notifications(pydantic.v1.BaseModel):
notifications: bool = False
# Although upstream supports it, pydantic has problems with Literal[None].
backend: typing.Optional[typing_extensions.Literal[
backend: typing.Optional[typing.Literal[
('gobject', 'growlnotify', 'applescript')]] = None
finished_querying_sticky: bool = True
task_crud_sticky: bool = True
Expand Down Expand Up @@ -306,7 +305,7 @@ class ServiceConfig(_ServiceConfig): # type: ignore # (dynamic base class)
# Optional fields shared by all services.
only_if_assigned: str = ''
also_unassigned: bool = False
default_priority: typing_extensions.Literal['', 'L', 'M', 'H'] = 'M'
default_priority: typing.Literal['', 'L', 'M', 'H'] = 'M'
add_tags: ConfigList = ConfigList([])
description_template: typing.Optional[str] = None

Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/docs/other-services/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Fire up your favorite editor and import the base classes and whatever library yo
import logging
import pathlib
import typing
import requests
import typing_extensions
from bugwarrior import config
from bugwarrior.services import Service, Issue, Client
Expand All @@ -69,7 +69,7 @@ Now define an initial configuration schema as follows. Don't worry, we're about
.. code:: python
class GitbugConfig(config.ServiceConfig):
service: typing_extensions.Literal['gitbug']
service: typing.Literal['gitbug']
path: pathlib.Path
Expand Down
3 changes: 1 addition & 2 deletions bugwarrior/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from jinja2 import Template
import pytz
import requests
import typing_extensions

from bugwarrior.config import schema, secrets

Expand Down Expand Up @@ -154,7 +153,7 @@ def get_tags_from_labels(self,

return tags

def get_priority(self) -> typing_extensions.Literal['', 'L', 'M', 'H']:
def get_priority(self) -> typing.Literal['', 'L', 'M', 'H']:
""" Return the priority of this issue, falling back to ``default_priority`` configuration.
"""
return self.PRIORITY_MAP.get(
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/activecollab.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re
import typing

import pypandoc
from pyac.library import activeCollab
import typing_extensions
from bugwarrior.services import Service, Issue
from bugwarrior import config

Expand All @@ -11,7 +11,7 @@


class ActiveCollabConfig(config.ServiceConfig):
service: typing_extensions.Literal['activecollab']
service: typing.Literal['activecollab']
url: config.StrippedTrailingSlashUrl
key: str
user_id: int
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/activecollab2.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import itertools
import time
import typing

import requests
import typing_extensions

from bugwarrior.services import Service, Issue, Client
from bugwarrior import config
Expand Down Expand Up @@ -31,7 +31,7 @@ def validate(cls, projects_raw):


class ActiveCollab2Config(config.ServiceConfig):
service: typing_extensions.Literal['activecollab2']
service: typing.Literal['activecollab2']
url: config.StrippedTrailingSlashUrl
key: str
user_id: int
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/azuredevops.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import logging
import re
import sys
import typing
from urllib.parse import quote

import requests
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue, Client
Expand All @@ -25,7 +25,7 @@ def validate(cls, value):


class AzureDevopsConfig(config.ServiceConfig):
service: typing_extensions.Literal['azuredevops']
service: typing.Literal['azuredevops']
PAT: str
project: EscapedStr
organization: EscapedStr
Expand Down
7 changes: 3 additions & 4 deletions bugwarrior/services/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pydantic.v1
import requests
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue, Client
Expand All @@ -13,9 +12,9 @@

class BitbucketConfig(config.ServiceConfig):
_DEPRECATE_FILTER_MERGE_REQUESTS = True
filter_merge_requests: typing.Union[bool, typing_extensions.Literal['Undefined']] = 'Undefined'
filter_merge_requests: typing.Union[bool, typing.Literal['Undefined']] = 'Undefined'

service: typing_extensions.Literal['bitbucket']
service: typing.Literal['bitbucket']

username: str

Expand All @@ -27,7 +26,7 @@ class BitbucketConfig(config.ServiceConfig):

include_repos: config.ConfigList = config.ConfigList([])
exclude_repos: config.ConfigList = config.ConfigList([])
include_merge_requests: typing.Union[bool, typing_extensions.Literal['Undefined']] = 'Undefined'
include_merge_requests: typing.Union[bool, typing.Literal['Undefined']] = 'Undefined'
project_owner_prefix: bool = False

@pydantic.v1.root_validator
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/bts.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
import typing

import pydantic.v1
import requests
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Issue, Service, Client
Expand All @@ -22,7 +22,7 @@


class BTSConfig(config.ServiceConfig):
service: typing_extensions.Literal['bts']
service: typing.Literal['bts']

email: pydantic.v1.EmailStr = pydantic.v1.EmailStr('')
packages: config.ConfigList = config.ConfigList([])
Expand Down
3 changes: 1 addition & 2 deletions bugwarrior/services/bz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import bugzilla
import pydantic.v1
import pytz
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue
Expand All @@ -34,7 +33,7 @@ def validate(cls, value, field, config):


class BugzillaConfig(config.ServiceConfig):
service: typing_extensions.Literal['bugzilla']
service: typing.Literal['bugzilla']
username: str
base_uri: OptionalSchemeUrl

Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/deck.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import datetime
import logging
import typing

import requests
import typing_extensions
from dateutil.tz import tzutc

from bugwarrior import config
Expand All @@ -12,7 +12,7 @@


class NextcloudDeckConfig(config.ServiceConfig):
service: typing_extensions.Literal['deck']
service: typing.Literal['deck']
base_uri: config.StrippedTrailingSlashUrl
username: str

Expand Down
3 changes: 1 addition & 2 deletions bugwarrior/services/gerrit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
import typing

import requests
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue, Client


class GerritConfig(config.ServiceConfig):
service: typing_extensions.Literal['gerrit']
service: typing.Literal['gerrit']
base_uri: config.StrippedTrailingSlashUrl
username: str
password: str
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/gitbug.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import signal
import subprocess
import sys
import typing

import requests
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue, Client
Expand All @@ -14,7 +14,7 @@


class GitBugConfig(config.ServiceConfig):
service: typing_extensions.Literal['gitbug']
service: typing.Literal['gitbug']

path: config.ExpandedPath

Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/github.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import re
import sys
import typing
import urllib.parse

import pydantic.v1
import requests
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue, Client
Expand All @@ -17,7 +17,7 @@ class GithubConfig(config.ServiceConfig):
password: str = 'Deprecated'

# strictly required
service: typing_extensions.Literal['github']
service: typing.Literal['github']
login: str
token: str

Expand Down
9 changes: 4 additions & 5 deletions bugwarrior/services/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@

import pydantic.v1
import sys
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue, Client

import logging
log = logging.getLogger(__name__)

DefaultPriority = typing_extensions.Literal['', 'L', 'M', 'H', 'unassigned']
DefaultPriority = typing.Literal['', 'L', 'M', 'H', 'unassigned']


class GitlabConfig(config.ServiceConfig):
_DEPRECATE_FILTER_MERGE_REQUESTS = True
filter_merge_requests: typing.Union[bool, typing_extensions.Literal['Undefined']] = 'Undefined'
filter_merge_requests: typing.Union[bool, typing.Literal['Undefined']] = 'Undefined'

service: typing_extensions.Literal['gitlab']
service: typing.Literal['gitlab']
login: str
token: str
host: config.NoSchemeUrl
Expand All @@ -32,7 +31,7 @@ class GitlabConfig(config.ServiceConfig):
owned: typing.Optional[bool] = None
import_labels_as_tags: bool = False
label_template: str = '{{label}}'
include_merge_requests: typing.Union[bool, typing_extensions.Literal['Undefined']] = 'Undefined'
include_merge_requests: typing.Union[bool, typing.Literal['Undefined']] = 'Undefined'
include_issues: bool = True
include_todos: bool = False
include_all_todos: bool = True
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import pickle
import re
import time
import typing

import googleapiclient.discovery
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Service, Issue
Expand All @@ -18,7 +18,7 @@


class GmailConfig(config.ServiceConfig):
service: typing_extensions.Literal['gmail']
service: typing.Literal['gmail']

client_secret_path: config.ExpandedPath = config.ExpandedPath(
'~/.gmail_client_secret.json')
Expand Down
3 changes: 1 addition & 2 deletions bugwarrior/services/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from functools import reduce

import pydantic.v1
import typing_extensions
from dateutil.tz.tz import tzutc
from jira.client import JIRA as BaseJIRA
from requests.cookies import RequestsCookieJar
Expand Down Expand Up @@ -77,7 +76,7 @@ def extract_value(self, fields):


class JiraConfig(config.ServiceConfig):
service: typing_extensions.Literal['jira']
service: typing.Literal['jira']
base_uri: pydantic.v1.AnyUrl
username: str

Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/services/kanboard.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import datetime
import logging
import re
import typing
from urllib.parse import urlparse

from dateutil.tz.tz import tzutc
from kanboard import Client
import typing_extensions

from bugwarrior import config
from bugwarrior.services import Issue, Service
Expand All @@ -14,7 +14,7 @@


class KanboardConfig(config.ServiceConfig):
service: typing_extensions.Literal['kanboard']
service: typing.Literal['kanboard']
url: config.StrippedTrailingSlashUrl
username: str
password: str
Expand Down
Loading

0 comments on commit 7e66aff

Please sign in to comment.