Skip to content

Commit

Permalink
183 drop python 38 support (#197)
Browse files Browse the repository at this point in the history
* Drop Support

- dropping support for python3.8 its EOL soon.
- updating gitignore

* Update pyproject.toml

- stop building wheels for python3.8

* Sphinx

- doing docs builds

* Workflows

- drop support for python3.8 in workflow files
- added `python_requires` with proper supported versions

* PyTest

- trying .txt instead of .log

* Update tests.yml

- manual "Create multi-file output listing".
  • Loading branch information
carlkidcrypto authored Sep 27, 2024
1 parent 5ba84a0 commit e62983e
Show file tree
Hide file tree
Showing 32 changed files with 214 additions and 116 deletions.
1 change: 0 additions & 1 deletion .github/comment-valgrind-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

| Python Version | Results | OS Version |
| --------------- | --------------- | ------------- |
| 3.8 | {{ .py3_8 }} | ubuntu-latest |
| 3.9 | {{ .py3_9 }} | ubuntu-latest |
| 3.10 | {{ .py3_10 }} | ubuntu-latest |
| 3.11 | {{ .py3_11 }} | ubuntu-latest |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Set up dependencies
Expand Down
49 changes: 20 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Set up dependencies
Expand Down Expand Up @@ -122,15 +122,15 @@ jobs:
)
echo 'PYTHONMALLOC=malloc' >> $GITHUB_OUTPUT
fi
${VALGRIND[@]} python -m pytest ${PYTEST_ARGS[@]} --junitxml=test-results_${{ matrix.os }}_${{ matrix.python-version }}.xml | tee ./test-outputs_${{ matrix.os }}_${{ matrix.python-version }}.log
${VALGRIND[@]} python -m pytest ${PYTEST_ARGS[@]} --junitxml=test-results_${{ matrix.os }}_${{ matrix.python-version }}.xml | tee ./test-outputs_${{ matrix.os }}_${{ matrix.python-version }}.txt
- name: Upload Test Results
uses: actions/upload-artifact@v4
with:
name: pytest-results_${{matrix.os}}_${{matrix.python-version}}
path: |
test-results_${{ matrix.os }}_${{ matrix.python-version }}.xml
test-outputs_${{ matrix.os }}_${{ matrix.python-version }}.log
test-outputs_${{ matrix.os }}_${{ matrix.python-version }}.txt
- name: Upload Valgrind Reports
uses: actions/upload-artifact@v4
Expand All @@ -149,19 +149,6 @@ jobs:
pattern: pytest-results_*
merge-multiple: false

- name: Create multi-file output listing
run: |
cd /home/runner/work/ezsnmp/ezsnmp/
echo 'pytest_multiple_files<<EOF' >> $GITHUB_OUTPUT
export test_xml=($(ls -d pytest-results_*latest_*/*.xml | sort ))
export test_log=($(ls -d pytest-results_*latest_*/*.log | sort ))
for i in "${!test_log[@]}"
do
echo "$(echo ${test_log[$i]} | cut -d_ -f2) - $(echo ${test_log[$i]%.*} | cut -d_ -f3), ${test_log[$i]}, ${test_xml[$i]}" >> $GITHUB_OUTPUT
done
echo 'EOF' >> $GITHUB_OUTPUT
echo $GITHUB_OUTPUT
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@v1.1.52
with:
Expand All @@ -172,7 +159,14 @@ jobs:
hide-comment: false
report-only-changed-files: false
multiple-files: |
${{ env.pytest_multiple_files }}
macos-latest - 3.9/test-outputs, pytest-results_macos-latest_3.9/test-outputs_macos-latest_3.9.txt, pytest-results_macos-latest_3.9/test-results_macos-latest_3.9.xml
macos-latest - 3.10/test-outputs, pytest-results_macos-latest_3.10/test-outputs_macos-latest_3.10.txt, pytest-results_macos-latest_3.10/test-results_macos-latest_3.10.xml
macos-latest - 3.11/test-outputs, pytest-results_macos-latest_3.11/test-outputs_macos-latest_3.11.txt, pytest-results_macos-latest_3.11/test-results_macos-latest_3.11.xml
macos-latest - 3.12/test-outputs, pytest-results_macos-latest_3.12/test-outputs_macos-latest_3.12.txt, pytest-results_macos-latest_3.12/test-results_macos-latest_3.12.xml
ubuntu-latest - 3.9/test-outputs, pytest-results_ubuntu-latest_3.9/test-outputs_ubuntu-latest_3.9.txt, pytest-results_ubuntu-latest_3.9/test-results_ubuntu-latest_3.9.xml
ubuntu-latest - 3.10/test-outputs, pytest-results_ubuntu-latest_3.10/test-outputs_ubuntu-latest_3.10.txt, pytest-results_ubuntu-latest_3.10/test-results_ubuntu-latest_3.10.xml
ubuntu-latest - 3.11/test-outputs, pytest-results_ubuntu-latest_3.11/test-outputs_ubuntu-latest_3.11.txt, pytest-results_ubuntu-latest_3.11/test-results_ubuntu-latest_3.11.xml
ubuntu-latest - 3.12/test-outputs, pytest-results_ubuntu-latest_3.12/test-outputs_ubuntu-latest_3.12.txt, pytest-results_ubuntu-latest_3.12/test-results_ubuntu-latest_3.12.xml
make-stripped-valgrind-files:
runs-on: ${{ matrix.os }}
Expand All @@ -181,7 +175,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Download Artifacts
Expand Down Expand Up @@ -226,16 +220,14 @@ jobs:
- name: Set Env Variables
id: valgrind_stripped_vars
run: |
temp1=$(cat valgrind-stripped_ubuntu-latest_3.8/valgrind-stripped_ubuntu-latest_3.8.log);
temp2=$(cat valgrind-stripped_ubuntu-latest_3.9/valgrind-stripped_ubuntu-latest_3.9.log);
temp3=$(cat valgrind-stripped_ubuntu-latest_3.10/valgrind-stripped_ubuntu-latest_3.10.log);
temp4=$(cat valgrind-stripped_ubuntu-latest_3.11/valgrind-stripped_ubuntu-latest_3.11.log);
temp5=$(cat valgrind-stripped_ubuntu-latest_3.12/valgrind-stripped_ubuntu-latest_3.12.log);
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_8=$temp1 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_9=$temp2 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_10=$temp3 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_11=$temp4 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_12=$temp5 >> $GITHUB_OUTPUT;
temp1=$(cat valgrind-stripped_ubuntu-latest_3.9/valgrind-stripped_ubuntu-latest_3.9.log);
temp2=$(cat valgrind-stripped_ubuntu-latest_3.10/valgrind-stripped_ubuntu-latest_3.10.log);
temp3=$(cat valgrind-stripped_ubuntu-latest_3.11/valgrind-stripped_ubuntu-latest_3.11.log);
temp4=$(cat valgrind-stripped_ubuntu-latest_3.12/valgrind-stripped_ubuntu-latest_3.12.log);
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_9=$temp1 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_10=$temp2 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_11=$temp3 >> $GITHUB_OUTPUT;
echo VALGRIND_STRIPPED_UBUNTU_LATEST_3_12=$temp4 >> $GITHUB_OUTPUT;
- name: Checkout Sourcecode
uses: actions/checkout@v4
Expand All @@ -246,7 +238,6 @@ jobs:
with:
template: .github/comment-valgrind-template.md
vars: |
py3_8: "${{ steps.valgrind_stripped_vars.outputs.VALGRIND_STRIPPED_UBUNTU_LATEST_3_8 }}"
py3_9: "${{ steps.valgrind_stripped_vars.outputs.VALGRIND_STRIPPED_UBUNTU_LATEST_3_9 }}"
py3_10: "${{ steps.valgrind_stripped_vars.outputs.VALGRIND_STRIPPED_UBUNTU_LATEST_3_10 }}"
py3_11: "${{ steps.valgrind_stripped_vars.outputs.VALGRIND_STRIPPED_UBUNTU_LATEST_3_11 }}"
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ dev/
*/*.log
*.log
wheelhouse/**
.DS_Store
*.o
**.DS_Store**
**venv**
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/exceptions.doctree
Binary file not shown.
Binary file modified docs/doctrees/ez.doctree
Binary file not shown.
Binary file modified docs/doctrees/helpers.doctree
Binary file not shown.
Binary file modified docs/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/doctrees/modules.doctree
Binary file not shown.
Binary file modified docs/doctrees/session.doctree
Binary file not shown.
Binary file modified docs/doctrees/utils.doctree
Binary file not shown.
Binary file modified docs/doctrees/variables.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 00675fa2c0a114acca2acbda5bf5e901
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/html/_static/css/theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: 'V1.0.0',
VERSION: 'V1.1.0a1',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
185 changes: 141 additions & 44 deletions docs/html/_static/js/versions.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
function renderLanguages(config) {
if (!config.projects.translations.length) {
return "";
}

const languagesHTML = `
<dl>
<dt>Languages</dt>
${ config.projects.translations.map(
(translation) => `
<dd ${ translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : '' }>
<a href="${ translation.urls.documentation }">${ translation.language.code }</a>
</dd>
`).join("\n")}
</dl>
`;
return languagesHTML;
}
const themeFlyoutDisplay = "hidden";
const themeVersionSelector = "True";
const themeLanguageSelector = "True";

if (themeFlyoutDisplay === "attached") {
function renderLanguages(config) {
if (!config.projects.translations.length) {
return "";
}

const languagesHTML = `
<dl>
<dt>Languages</dt>
${config.projects.translations
.map(
(translation) => `
<dd ${translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : ""}>
<a href="${translation.urls.documentation}">${translation.language.code}</a>
</dd>
`,
)
.join("\n")}
</dl>
`;
return languagesHTML;
}

function renderVersions(config) {
if (!config.versions.active.length) {
Expand All @@ -24,12 +32,15 @@ function renderLanguages(config) {
const versionsHTML = `
<dl>
<dt>Versions</dt>
${ config.versions.active.map(
(version) => `
<dd ${ version.slug === config.versions.current.slug ? 'class="rtd-current-item"' : '' }>
<a href="${ version.urls.documentation }">${ version.slug }</a>
${config.versions.active
.map(
(version) => `
<dd ${version.slug === config.versions.current.slug ? 'class="rtd-current-item"' : ""}>
<a href="${version.urls.documentation}">${version.slug}</a>
</dd>
`).join("\n")}
`,
)
.join("\n")}
</dl>
`;
return versionsHTML;
Expand All @@ -48,42 +59,45 @@ function renderLanguages(config) {
const downloadsHTML = `
<dl>
<dt>Downloads</dt>
${ Object.entries(config.versions.current.downloads).map(
([name, url]) => `
${Object.entries(config.versions.current.downloads)
.map(
([name, url]) => `
<dd>
<a href="${ url }">${ downloadsNameDisplay[name] }</a>
<a href="${url}">${downloadsNameDisplay[name]}</a>
</dd>
`).join("\n")}
`,
)
.join("\n")}
</dl>
`;
return downloadsHTML;
}

document.addEventListener("readthedocs-addons-data-ready", function(event) {
document.addEventListener("readthedocs-addons-data-ready", function (event) {
const config = event.detail.data();

const flyout = `
<div class="rst-versions" data-toggle="rst-versions" role="note">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Read the Docs</span>
v: ${ config.versions.current.slug }
v: ${config.versions.current.slug}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<div class="injected">
${ renderLanguages(config) }
${ renderVersions(config) }
${ renderDownloads(config) }
${renderLanguages(config)}
${renderVersions(config)}
${renderDownloads(config)}
<dl>
<dt>On Read the Docs</dt>
<dd>
<a href="${ config.projects.current.urls.home }">Project Home</a>
<a href="${config.projects.current.urls.home}">Project Home</a>
</dd>
<dd>
<a href="${ config.projects.current.urls.builds }">Builds</a>
<a href="${config.projects.current.urls.builds}">Builds</a>
</dd>
<dd>
<a href="${ config.projects.current.urls.downloads }">Downloads</a>
<a href="${config.projects.current.urls.downloads}">Downloads</a>
</dd>
</dl>
<dl>
Expand Down Expand Up @@ -112,14 +126,97 @@ function renderLanguages(config) {
document.body.insertAdjacentHTML("beforeend", flyout);

// Trigger the Read the Docs Addons Search modal when clicking on the "Search docs" input from inside the flyout.
document.querySelector("#flyout-search-form").addEventListener("focusin", () => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
});
document
.querySelector("#flyout-search-form")
.addEventListener("focusin", () => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
});

// Trigger the Read the Docs Addons Search modal when clicking on "Search docs" input from the topnav.
document.querySelector("[role='search'] input").addEventListener("focusin", () => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
});
});
document
.querySelector("[role='search'] input")
.addEventListener("focusin", () => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
});
});
}

if (themeLanguageSelector || themeVersionSelector) {
function onSelectorSwitch(event) {
const option = event.target.selectedIndex;
const item = event.target.options[option];
window.location.href = item.dataset.url;
}

document.addEventListener("readthedocs-addons-data-ready", function (event) {
const config = event.detail.data();

const versionSwitch = document.querySelector(
"div.switch-menus > div.version-switch",
);
if (themeVersionSelector) {
let versions = config.versions.active;
if (config.versions.current.type === "external") {
versions.unshift(config.versions.current);
}
const versionSelect = `
<select>
${versions
.map(
(version) => `
<option
value="${version.slug}"
${config.versions.current.slug === version.slug ? 'selected="selected"' : ""}
data-url="${version.urls.documentation}">
${version.slug}
</option>`,
)
.join("\n")}
</select>
`;

versionSwitch.innerHTML = versionSelect;
versionSwitch.firstElementChild.addEventListener("change", onSelectorSwitch);
}

const languageSwitch = document.querySelector(
"div.switch-menus > div.language-switch",
);

if (themeLanguageSelector) {
if (config.projects.translations.length) {
// Add the current language to the options on the selector
let languages = config.projects.translations.concat(
config.projects.current,
);
languages = languages.sort((a, b) =>
a.language.name.localeCompare(b.language.name),
);

const languageSelect = `
<select>
${languages
.map(
(language) => `
<option
value="${language.language.code}"
${config.projects.current.slug === language.slug ? 'selected="selected"' : ""}
data-url="${language.urls.documentation}">
${language.language.name}
</option>`,
)
.join("\n")}
</select>
`;

languageSwitch.innerHTML = languageSelect;
languageSwitch.firstElementChild.addEventListener("change", onSelectorSwitch);
}
else {
languageSwitch.remove();
}
}
});
}
6 changes: 3 additions & 3 deletions docs/html/exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ezsnmp.exceptions module &mdash; Ez SNMP V1.0.0 documentation</title>
<title>ezsnmp.exceptions module &mdash; Ez SNMP V1.1.0a1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=66b59bf7" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=7ab3649f" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=f2281d4f"></script>
<script src="_static/documentation_options.js?v=e23586ef"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
Loading

2 comments on commit e62983e

@github-actions
Copy link

Choose a reason for hiding this comment

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

Title Coverage Tests Skipped Failures Errors Time
macos-latest - 3.9/test-outputs 316 0 💤 0 ❌ 0 🔥 24.724s ⏱️
macos-latest - 3.10/test-outputs 316 0 💤 0 ❌ 0 🔥 23.284s ⏱️
macos-latest - 3.11/test-outputs 316 0 💤 0 ❌ 0 🔥 24.476s ⏱️
macos-latest - 3.12/test-outputs 316 0 💤 1 ❌ 0 🔥 25.515s ⏱️
ubuntu-latest - 3.9/test-outputs 316 0 💤 0 ❌ 0 🔥 2m 47s ⏱️
ubuntu-latest - 3.10/test-outputs 316 0 💤 0 ❌ 0 🔥 2m 49s ⏱️
ubuntu-latest - 3.11/test-outputs 316 0 💤 0 ❌ 0 🔥 2m 57s ⏱️
ubuntu-latest - 3.12/test-outputs 316 0 💤 0 ❌ 0 🔥 3m 44s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

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

Valgrind Comment

Python Version Results OS Version
3.9 sh ==8321== LEAK SUMMARY: ==8321== definitely lost: 112 bytes in 7 blocks ==8321== indirectly lost: 0 bytes in 0 blocks ==8321== possibly lost: 307,317 bytes in 467 blocks ==8321== still reachable: 2,422,844 bytes in 1,440 blocks ==8321== suppressed: 68,037 bytes in 163 blocks ==8321== Reachable blocks (those to which a pointer was found) are not shown. ==8321== To see them, rerun with: --leak-check=full --show-leak-kinds=all ubuntu-latest
3.10 sh ==8250== LEAK SUMMARY: ==8250== definitely lost: 112 bytes in 7 blocks ==8250== indirectly lost: 0 bytes in 0 blocks ==8250== possibly lost: 263,820 bytes in 394 blocks ==8250== still reachable: 1,770,331 bytes in 1,373 blocks ==8250== suppressed: 68,403 bytes in 163 blocks ==8250== Reachable blocks (those to which a pointer was found) are not shown. ==8250== To see them, rerun with: --leak-check=full --show-leak-kinds=all ubuntu-latest
3.11 sh ==8277== LEAK SUMMARY: ==8277== definitely lost: 5,296 bytes in 13 blocks ==8277== indirectly lost: 8,990 bytes in 10 blocks ==8277== possibly lost: 8,714 bytes in 10 blocks ==8277== still reachable: 10,698,595 bytes in 141,009 blocks ==8277== suppressed: 69,988 bytes in 166 blocks ==8277== Reachable blocks (those to which a pointer was found) are not shown. ==8277== To see them, rerun with: --leak-check=full --show-leak-kinds=all ubuntu-latest
3.12 sh ==8198== LEAK SUMMARY: ==8198== definitely lost: 5,592 bytes in 13 blocks ==8198== indirectly lost: 2,028 bytes in 3 blocks ==8198== possibly lost: 4,152 bytes in 6 blocks ==8198== still reachable: 10,606,033 bytes in 140,958 blocks ==8198== suppressed: 68,382 bytes in 163 blocks ==8198== Reachable blocks (those to which a pointer was found) are not shown. ==8198== To see them, rerun with: --leak-check=full --show-leak-kinds=all ubuntu-latest

Please sign in to comment.