Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8c03ef2
Initial migration of files into a pagerduty directory structure
Deconstrained Feb 14, 2025
fbb14b7
Fix version import
Deconstrained Feb 14, 2025
b49344d
Get tests to pass
Deconstrained Feb 14, 2025
a7b46f9
Finish new pyproject.toml build w/setuptools, update LICENSE, remove …
Deconstrained Feb 14, 2025
6c0c21c
Pip-install using pyproject.toml in tests
Deconstrained Feb 14, 2025
eb31169
Drop support for Python 3.6
Deconstrained Feb 14, 2025
396deb4
Update contribution guide according to the new build system changes
Deconstrained Feb 14, 2025
bfd390a
Move "auto_json" into rest_api_v2_client, the only place where it is …
Deconstrained Feb 14, 2025
934a698
Fix sphinx build reference to module version
Deconstrained Feb 14, 2025
faf3bfa
Use importlib to derive version from pyproject.toml
Deconstrained Mar 18, 2025
f148718
Move unit tests to a tests subdirectory and begin splitting it out in…
Deconstrained Mar 18, 2025
b3bdbe6
Use backwards-compatible-with-3.6-3.7 version fetching
Deconstrained Mar 18, 2025
3206282
Revert "Drop support for Python 3.6"
Deconstrained Mar 18, 2025
f66d704
Unconstrain the setuptools version to see if we can support Python 3.6
Deconstrained Mar 19, 2025
6757116
Use a fake version for Python versions prior to 3.8 because I am done…
Deconstrained Mar 19, 2025
f652dab
Split tests up into separate files
Deconstrained Mar 19, 2025
73faca3
Uniform import format in test.py and adding a missed-in-refactor test…
Deconstrained Mar 19, 2025
5c47627
Try using requirements.txt for the version 3.6 test
Deconstrained Mar 19, 2025
5bfdb68
Increment indentation for ad-hoc 3.6 test
Deconstrained Mar 19, 2025
eac1ebd
Trivial name/comment changes in version.py
Deconstrained Mar 19, 2025
6714c06
Update the contribution guide and changelog accordingly
Deconstrained Mar 19, 2025
d35fbd3
Give exception classes their own file
Deconstrained Mar 19, 2025
f32e6fa
Update pagerduty/errors.py
Deconstrained Mar 19, 2025
09ae5f1
Eliminate the use of mutable default arguments
Deconstrained Mar 19, 2025
d617935
Fix typo in contrib guide
Deconstrained Mar 19, 2025
f549840
Remove long-outdated docstring in the test entry script
Deconstrained Mar 19, 2025
fc03e7e
Make the beginning of the user agent header more distinct
Deconstrained Apr 7, 2025
a640d2b
Fix issue with Airflow
Deconstrained Apr 7, 2025
7ed7d90
Add None-return-value assertion to change events test
Deconstrained Apr 7, 2025
a7f1957
Use new auto-discovery testing structure
Deconstrained Apr 7, 2025
9b4eb3e
Stopgap for version getter in unit tests where no package has been built
Deconstrained Apr 7, 2025
9214596
Update changelog and use "?" for unknown versions in version.py
Deconstrained Apr 7, 2025
fb5989b
Change send_change_event docstring/return
Deconstrained Apr 7, 2025
06448c0
Change return type of EventsApiV2Client.submit
Deconstrained Apr 7, 2025
63f87e2
Update docstring of EventsApiV2Client.submit
Deconstrained Apr 7, 2025
8b395ea
Fix typo in user guide
Deconstrained Apr 7, 2025
c2c3437
Fix broken :class: references in user guide
Deconstrained Apr 7, 2025
2d4652d
Fix docbuild version resolution and update contrib guide
Deconstrained Apr 7, 2025
f64fef8
Absorb "unit test" into the setup instructions in the contrib guide
Deconstrained Apr 7, 2025
14c60e9
auto-generate copyright year
Deconstrained Apr 7, 2025
32f6b5e
Remove unnecessary return statement
Deconstrained Apr 7, 2025
eab29f0
Import "constants" from pagerduty.rest_api_v2_client into the root na…
Deconstrained Apr 7, 2025
4891a8c
Fix broken link in contrib guide
Deconstrained Apr 7, 2025
440c71d
Fix client default references and ensure their docstrings are rendered
Deconstrained Apr 7, 2025
2b73553
Fix Sphinx references to REST v2 helper methods
Deconstrained Apr 7, 2025
7cfa279
EventsApiV2Client.submit: Remove unnecessary return statement
Deconstrained Apr 8, 2025
6ddb39a
Update CHANGELOG entry and its date
Deconstrained Apr 8, 2025
77f9092
Use asterisks instead of question marks for unknown version
Deconstrained Apr 8, 2025
a107946
Rebuild docs
Deconstrained Apr 8, 2025
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
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ test: &test
python -V
which pip
pip -V
pip install -r requirements.txt
python ./test_pagerduty.py
./test.sh

jobs:

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ pagerduty.egg-info/
docs/.buildinfo
tmp/
.DS_Store
.tool-versions
*.swp
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.13.2
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
**2025-04-08: Multi-file refactor - Version 2.0.0**

This release introduces major structural changes to the module and how it is built and tested. These changes were made for long-term maintainability of the codebase. Previously, it was all contained within a monolithic ``.py`` file (with a single Python script for all unit tests); now it is organized into smaller, appropriately-named Python files.

Some lesser changes are also included:

* The docstrings for the ``submit`` and ``send_change_event`` methods of ``EventsApiV2Client`` have been updated to reflect how they are expected to always return ``None``; this was causing Airflow build failures.
* The default user agent header has been updated: the prefix has been changed from ``pagerduty`` to ``python-pagerduty``.
* The version number ``pagerduty.__version__`` is now maintained in ``pyproject.toml`` and discovered through package metadata introspection at import time. In Python versions prior to 3.8, the version will be ``2.*.*`` because the new ``importlib`` feature required for it is unavailable.

**2025-01-02: Migrate from PDPYRAS - Version 1.0.0**

* **BREAKING CHANGE:** class names have changed from what they were in ``pdpyras``; see: `PDPYRAS Migration Guide <https://pagerduty.github.io/python-pagerduty/pdpyras_migration_guide.html>`_
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 PagerDuty
Copyright (c) 2025 PagerDuty, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
%: dist
%: build

dist: pagerduty.py setup.py
rm -f dist/* && python setup.py sdist bdist_wheel --universal
build: pagerduty/* pyproject.toml
rm -f dist/* && python3 -m build

docs/index.html: pagerduty.py README.rst CHANGELOG.rst sphinx/source/conf.py sphinx/source/*.rst
docs/index.html: pagerduty/* README.rst CHANGELOG.rst sphinx/source/*
rm -fr ./docs && cd sphinx && make html && cd .. && mv sphinx/build/html ./docs && touch ./docs/.nojekyll

docs: docs/index.html
docs: docs/index.html pagerduty/__pycache__

install: dist
python setup.py install
# Require the module be compiled first so metadata can be used:
pagerduty/__pycache__:
pip install .

testpublish: dist
testpublish: build
./publish-test.sh

publish: dist
publish: build
twine upload dist/*.tar.gz dist/*.whl
27 changes: 6 additions & 21 deletions docs/_static/basic.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
/*
* basic.css
* ~~~~~~~~~
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

/* -- main layout ----------------------------------------------------------- */
Expand Down Expand Up @@ -115,15 +108,11 @@ img {
/* -- search page ----------------------------------------------------------- */

ul.search {
margin: 10px 0 0 20px;
padding: 0;
margin-top: 10px;
}

ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
background-repeat: no-repeat;
background-position: 0 7px;
padding: 5px 0;
}

ul.search li a {
Expand Down Expand Up @@ -237,6 +226,10 @@ a.headerlink {
visibility: hidden;
}

a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -748,14 +741,6 @@ abbr, acronym {
cursor: help;
}

.translated {
background-color: rgba(207, 255, 207, 0.2)
}

.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}

/* -- code displays --------------------------------------------------------- */

pre {
Expand Down
7 changes: 0 additions & 7 deletions docs/_static/doctools.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
/*
* doctools.js
* ~~~~~~~~~~~
*
* Base JavaScript utilities for all Sphinx HTML documentation.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
"use strict";

Expand Down
5 changes: 2 additions & 3 deletions docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.0.0',
const DOCUMENTATION_OPTIONS = {
VERSION: '2.0.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
9 changes: 1 addition & 8 deletions docs/_static/language_data.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
/*
* language_data.js
* ~~~~~~~~~~~~~~~~
*
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];


/* Non-minified version is copied as a separate JS file, is available */
/* Non-minified version is copied as a separate JS file, if available */

/**
* Porter Stemmer
Expand Down
67 changes: 34 additions & 33 deletions docs/_static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,70 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .err { border: 1px solid #F00 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .o { color: #666 } /* Operator */
.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .cs { color: #408090; background-color: #FFF0F0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #F00 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #333333 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .go { color: #333 } /* Generic.Output */
.highlight .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .gt { color: #04D } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #208050 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .s { color: #4070A0 } /* Literal.String */
.highlight .na { color: #4070A0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .nc { color: #0E84B5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60ADD5 } /* Name.Constant */
.highlight .nd { color: #555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #D55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nf { color: #06287E } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .nv { color: #BB60D5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .w { color: #BBB } /* Text.Whitespace */
.highlight .mb { color: #208050 } /* Literal.Number.Bin */
.highlight .mf { color: #208050 } /* Literal.Number.Float */
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
.highlight .mi { color: #208050 } /* Literal.Number.Integer */
.highlight .mo { color: #208050 } /* Literal.Number.Oct */
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sa { color: #4070A0 } /* Literal.String.Affix */
.highlight .sb { color: #4070A0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070A0 } /* Literal.String.Char */
.highlight .dl { color: #4070A0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070A0 } /* Literal.String.Double */
.highlight .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070A0 } /* Literal.String.Heredoc */
.highlight .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #C65D09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .s1 { color: #4070A0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #06287e } /* Name.Function.Magic */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
.highlight .fm { color: #06287E } /* Name.Function.Magic */
.highlight .vc { color: #BB60D5 } /* Name.Variable.Class */
.highlight .vg { color: #BB60D5 } /* Name.Variable.Global */
.highlight .vi { color: #BB60D5 } /* Name.Variable.Instance */
.highlight .vm { color: #BB60D5 } /* Name.Variable.Magic */
.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
Loading