Skip to content
Merged
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
23 changes: 13 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ on: push

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -24,23 +25,25 @@ jobs:
run: tox -e py

deploy:

if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ dmypy.json
.pyre/

# Offline version file
mlx/__version__.py
mlx/jira_traceability/_version.py
3 changes: 0 additions & 3 deletions mlx/__init__.py

This file was deleted.

12 changes: 12 additions & 0 deletions mlx/jira_traceability/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-

"""Sphinx plugin to create Jira tickets based on traceable items."""

from .jira_traceability import setup

try:
from ._version import __version__
except ImportError:
__version__ = "unknown"

__all__ = ['setup', '__version__']
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[build-system]
requires = ["setuptools>=77.0", "setuptools-scm>=8.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mlx.jira-traceability"
dynamic = ["version"]
authors = [
{name = "Jasper Craeghs", email = "[email protected]"},
]
description = "Sphinx plugin to create Jira tickets based on traceable items"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Sphinx :: Extension",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Documentation :: Sphinx",
"Topic :: Software Development :: Bug Tracking",
"Topic :: Utilities",
]
keywords = ["traceability", "jira", "sphinx"]
dependencies = [
"Sphinx>=2.1",
"jira>=3.2.0",
"mlx.traceability>=11.0.0",
]

[project.urls]
Homepage = "https://github.com/melexis/jira-traceability"
Repository = "https://github.com/melexis/jira-traceability"
Issues = "https://github.com/melexis/jira-traceability/issues"

[tool.setuptools]
zip-safe = false
include-package-data = true

[tool.setuptools.packages.find]
namespaces = true

[tool.setuptools_scm]
write_to = "mlx/jira_traceability/_version.py"
version_scheme = "no-guess-dev"

[tool.pytest.ini_options]
norecursedirs = ".tox"

[tool.flake8]
exclude = [".git", "*conf.py", "build", "dist"]
max-line-length = 120

[tool.check-manifest]
ignore = ["*.yml"]
16 changes: 0 additions & 16 deletions setup.cfg

This file was deleted.

50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

24 changes: 11 additions & 13 deletions tests/test_jira_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

from jira import JIRAError

from mlx.traceable_attribute import TraceableAttribute
from mlx.traceable_collection import TraceableCollection
from mlx.traceable_item import TraceableItem
import mlx.jira_interaction as dut
from mlx.traceability import TraceableAttribute, TraceableCollection, TraceableItem
import mlx.jira_traceability.jira_interaction as dut


def produce_fake_users(**kwargs):
Expand All @@ -21,7 +19,7 @@ def produce_fake_users(**kwargs):
return users


@mock.patch('mlx.jira_interaction.JIRA')
@mock.patch('mlx.jira_traceability.jira_interaction.JIRA')
class TestJiraInteraction(TestCase):
def setUp(self):
self.general_fields = {
Expand Down Expand Up @@ -86,7 +84,7 @@ def test_missing_endpoint(self, *_):
dut.create_jira_issues(self.settings, None)
self.assertEqual(
cm.output,
["WARNING:sphinx.mlx.jira_interaction:Jira interaction failed: configuration is "
["WARNING:sphinx.mlx.jira_traceability.jira_interaction:Jira interaction failed: configuration is "
"missing mandatory values for keys ['api_endpoint']"]
)

Expand All @@ -96,7 +94,7 @@ def test_missing_username(self, *_):
dut.create_jira_issues(self.settings, None)
self.assertEqual(
cm.output,
["WARNING:sphinx.mlx.jira_interaction:Jira interaction failed: configuration is "
["WARNING:sphinx.mlx.jira_traceability.jira_interaction:Jira interaction failed: configuration is "
"missing mandatory values for keys ['username']"]
)

Expand All @@ -108,7 +106,7 @@ def test_missing_all_mandatory(self, *_):
dut.create_jira_issues(self.settings, None)
self.assertEqual(
cm.output,
["WARNING:sphinx.mlx.jira_interaction:Jira interaction failed: configuration is "
["WARNING:sphinx.mlx.jira_traceability.jira_interaction:Jira interaction failed: configuration is "
"missing mandatory values for keys {}".format(mandatory_keys)]
)

Expand All @@ -121,7 +119,7 @@ def test_missing_all_optional_one_mandatory(self, *_):
dut.create_jira_issues(self.settings, None)
self.assertEqual(
cm.output,
["WARNING:sphinx.mlx.jira_interaction:Jira interaction failed: configuration is "
["WARNING:sphinx.mlx.jira_traceability.jira_interaction:Jira interaction failed: configuration is "
"missing mandatory values for keys ['password']"]
)

Expand Down Expand Up @@ -244,10 +242,10 @@ def test_prevent_duplication(self, jira):

self.assertEqual(
cm.output,
["WARNING:sphinx.mlx.jira_interaction:Won't create a Task for item "
["WARNING:sphinx.mlx.jira_traceability.jira_interaction:Won't create a Task for item "
"'ACTION-12345_ACTION_1' because the Jira API query to check to prevent "
"duplication returned ['Jira already contains this ticket']",
"WARNING:sphinx.mlx.jira_interaction:Won't create a Task for item "
"WARNING:sphinx.mlx.jira_traceability.jira_interaction:Won't create a Task for item "
"'ACTION-12345_ACTION_2' because the Jira API query to check to prevent "
"duplication returned ['Jira already contains this ticket']"]
)
Expand Down Expand Up @@ -307,8 +305,8 @@ def jira_add_watcher_mock(*_):
with self.assertLogs(level=WARNING) as cm:
dut.create_jira_issues(self.settings, self.coll)

error_msg = ("WARNING:sphinx.mlx.jira_interaction:Jira interaction failed: item ACTION-12345_ACTION_1: "
"error code 401: dummy msg")
error_msg = ("WARNING:sphinx.mlx.jira_traceability.jira_interaction:Jira interaction failed: "
"item ACTION-12345_ACTION_1: error code 401: dummy msg")
self.assertEqual(
cm.output,
[error_msg, error_msg]
Expand Down
22 changes: 12 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
[tox]
envlist =
py37, py38, py39, py10
py39, py310, py311, py312, py313
clean,
check,
{py37},
{py39},
requires =
pip>=20.3.4

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313

[testenv]
basepython =
py: python3
pypy: {env:TOXPYTHON:pypy}
py37: {env:TOXPYTHON:python3.7}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
py311: {env:TOXPYTHON:python3.11}
py312: {env:TOXPYTHON:python3.12}
py313: {env:TOXPYTHON:python3.13}
{clean,check,report,coveralls,codecov}: python3
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
passenv =
*
usedevelop = false
usedevelop = true
deps=
mock
pytest
Expand All @@ -42,16 +44,16 @@ commands=

[testenv:check]
deps =
docutils
build
twine
check-manifest
flake8
skip_install = true
commands =
python setup.py sdist
python -m build
twine check dist/*
check-manifest {toxinidir} -u
flake8 mlx tests setup.py
flake8 mlx tests

[testenv:coveralls]
deps =
Expand Down