Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI and drop support for py35 #1015

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c4f670e
style(client): move comment inline as black and flake are contradicting
Addono May 20, 2020
3bd06d9
ci(travis): use addono/jira-run-standalone as testing server instance
Addono Jan 25, 2020
f760c30
make getting started a little bit easier
studioj Apr 5, 2021
95caba7
update setup.cfg
adehad Apr 24, 2021
44a5249
updating tox side for Windows devs
adehad Apr 24, 2021
bd95d66
Merge branch 'improve_getting_started_documentation_for_ci_fixing' in…
adehad Apr 24, 2021
915cd9f
Merge remote-tracking branch 'origin/master' into fix_ci
adehad Apr 24, 2021
09ac5ea
new properties that use rest_api_version and rest_path
adehad Apr 24, 2021
a71a412
replace server property with server_url property
adehad Apr 25, 2021
e2a8957
bump pytest versions
adehad Apr 25, 2021
717bc32
tidy some travis things
adehad Apr 25, 2021
0443d31
using GH Actions
Apr 25, 2021
ef9c03a
fixing kerberos install
Apr 26, 2021
1d4b13d
waiting for docker
Apr 26, 2021
2ee10f5
satisfy lint, split ci into lint vs test sections,
adehad Apr 30, 2021
15dd2a3
adding all py versions and pip cache
studioj May 1, 2021
225608b
fix docs build
adehad Apr 30, 2021
e44abe8
bump lint versions
adehad May 1, 2021
15f64d2
commit package lock file
adehad May 1, 2021
19f397c
avoid duplicate builds running ?
adehad May 1, 2021
03fb317
update developer instructions
adehad May 1, 2021
ebc4429
clean legacy
adehad May 1, 2021
95ff1f9
fix lint, add guidance for Windows users
adehad May 1, 2021
e7c62a5
Upgrade to GitHub-native Dependabot
adehad Apr 30, 2021
4afa955
drop support for py 35
studioj May 1, 2021
2f357e9
Update setup.cfg
ssbarnea May 2, 2021
7f385bd
Update setup.cfg
ssbarnea May 2, 2021
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
24 changes: 19 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
language: python
dist: xenial
services:
- docker
# Build only commits on master and release tags for the "Build pushed branches" feature.
# This prevents building twice on PRs originating from our repo ("Build pushed pull requests)".
# See:
# - https://github.com/travis-ci/travis-ci/issues/1147
# - https://docs.travis-ci.com/user/pull-requests/#double-builds-on-pull-requests
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
# branches:
# only:
# - master
# - /^\d+\.\d+(\.\d+)?(-\S*)?$/

cache:
bundler: true
Expand All @@ -28,6 +30,14 @@ stages:
before_install:
- pip install --upgrade tox tox-venv
- rm -rf .tox
# Launch a Jira instance in detached mode
- docker run -dit -p 2990:2990 --name jira addono/jira-software-standalone
# Wait until Jira has booted
- until $(curl -u $CI_JIRA_ADMIN:$CI_JIRA_ADMIN_PASSWORD --output /dev/null --silent --head --fail $CI_JIRA_URL/rest/api/2/permissions); do sleep 5; done
# Install this repository, as we will need it in the next step
- pip install .
# Attempt to create the test user, as the empty JIRA instance isn't provisioned with one
- (python -c "from jira import JIRA; JIRA('$CI_JIRA_URL', basic_auth=('$CI_JIRA_ADMIN', '$CI_JIRA_ADMIN_PASSWORD')).add_user('$CI_JIRA_USER', '[email protected]', password='$CI_JIRA_USER_PASSWORD')" && echo "Created user '$CI_JIRA_USER'") || (echo "Failed creating user '$CI_JIRA_USER'" && docker logs --tail 500 jira)
notifications:
email:
- [email protected]
Expand Down Expand Up @@ -72,5 +82,9 @@ jobs:
branch: master
env:
global:
- secure: "pGQGM5YmHvOgaKihOyzb3k6bdqLQnZQ2OXO9QrfXlXwtop3zvZQi80Q+01l230x2psDWlwvqWTknAjAt1w463fYXPwpoSvKVCsLSSbjrf2l56nrDqnoir+n0CBy288+eIdaGEfzcxDiuULeKjlg08zrqjcjLjW0bDbBrlTXsb5U="
- PIP_DISABLE_PIP_VERSION_CHECK=1
- CI_JIRA_URL=http://localhost:2990/jira
- CI_JIRA_ADMIN=admin
- CI_JIRA_ADMIN_PASSWORD=admin
- CI_JIRA_USER=jira_user
- CI_JIRA_USER_PASSWORD=jira
5 changes: 2 additions & 3 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,8 @@ def __init__(
self._create_kerberos_session(timeout, kerberos_options=kerberos_options)
elif auth:
self._create_cookie_auth(auth, timeout)
validate = (
True
) # always log in for cookie based auth, as we need a first request to be logged in
# always log in for cookie based auth, as we need a first request to be logged in
validate = True
else:
verify = self._options["verify"]
self._session = ResilientSession(timeout=timeout)
Expand Down
16 changes: 16 additions & 0 deletions make_local_jira_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from jira import JIRA
Copy link
Collaborator

@studioj studioj Apr 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice i wash just cleaning up that functionality too 👍
maybe this can be used in the test.local script too

from os import environ


try:
JIRA(
environ["CI_JIRA_URL"],
basic_auth=(environ["CI_JIRA_ADMIN"], environ["CI_JIRA_ADMIN_PASSWORD"]),
).add_user(
environ["CI_JIRA_USER"],
"[email protected]",
password=environ["CI_JIRA_USER_PASSWORD"],
)
except Exception as e:
if not "username already exists" in str(e):
raise e
14 changes: 7 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[metadata]
name = jira
author = Ben Speakmon
author-email = [email protected]
author_email = [email protected]
maintainer = Sorin Sbarnea
maintainer-email = [email protected]
maintainer_email = [email protected]
summary = Python library for interacting with JIRA via REST APIs.
long-description = file: README.rst
long_description = file: README.rst
# Do not include ChangeLog in description-file due to multiple reasons:
# - Unicode chars, see https://github.com/pycontribs/jira/issues/512
# - Breaks ability to perform `python setup.py install`
long-description-content-type = text/x-rst; charset=UTF-8
home-page = https://github.com/pycontribs/jira
project-urls =
long_description_content_type = text/x-rst; charset=UTF-8
url = https://github.com/pycontribs/jira
project_urls =
Bug Tracker = https://github.com/pycontribs/jira/issues
Release Management = https://github.com/pycontribs/jira/projects
CI: Travis = https://travis-ci.com/pycontribs/jira
Source Code = https://github.com/pycontribs/jira.git
Documentation = https://jira.readthedocs.io/en/master/
Forum = https://community.atlassian.com/t5/tag/jira-python/tg-p?sort=recent
requires-python = >=3.5
requires_python = >=3.5
platforms = any
license = BSD
classifiers =
Expand Down
15 changes: 13 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,22 @@ extras =
test
sitepackages=False
commands=
bash -c 'find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf'
git clean -xdf jira tests
; bash -c 'find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf'
python -m pip check
python make_local_jira_user.py
python -m pytest {posargs}
setenv =
PIP_LOG={envdir}/pip.log
PIP_DISABLE_PIP_VERSION_CHECK=1
# Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
CI_JIRA_URL=http://localhost:2990/jira
CI_JIRA_ADMIN=admin
CI_JIRA_ADMIN_PASSWORD=admin
CI_JIRA_USER=jira_user
CI_JIRA_USER_PASSWORD=jira
CI_JIRA_ISSUE=Task
passenv =
CI
CI_JIRA_*
Expand All @@ -65,6 +73,8 @@ passenv =
TRAVIS*
TWINE_*
XDG_CACHE_HOME
# For Windows users, getpass.get_user() needs USERNAME
USERNAME
envars =
PIP_DISABLE_PIP_VERSION_CHECK=1
PIP_USER=no
Expand All @@ -85,7 +95,8 @@ deps =
twine>=2.0.0
wheel>=0.33.6
commands =
rm -rf {toxinidir}/dist
git clean -xdf dist
; rm -rf {toxinidir}/dist
python setup.py check -m -s
# disabled due to errors with older setuptools:
# python setup.py sdist bdist_wheel
Expand Down