Skip to content

Commit

Permalink
Merge pull request #89 from phargogh/task/88-update-for-python-versions
Browse files Browse the repository at this point in the history
Update python versions supported (-3.6, +3.11)
  • Loading branch information
dcdenu4 authored Apr 19, 2023
2 parents d39cc64 + 10695c5 commit b8a8d66
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand All @@ -29,7 +29,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions flake8
# See this comment about the importlib_metadata constraint:
# https://github.com/python/importlib_metadata/issues/406#issuecomment-1264666048
pip install tox tox-gh-actions flake8 "importlib_metadata<5" rstcheck
- name: Lint with flake8
run: |
Expand Down
7 changes: 6 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
TaskGraph Release History
=========================

.. Unreleased Changes
Unreleased Changes
------------------
* Python 3.6 has reached end-of-life and is no longer maintained, so it has
been removed from the automated tests.
* Python 3.11 has been released, so ``taskgraph`` is now tested against this
new version of the language.

0.11.0 (2021-10-12)
-------------------
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""taskgraph setup.py."""
from setuptools import setup


_REQUIREMENTS = [
x for x in open('requirements.txt').read().split('\n')
if not x.startswith('#') and len(x) > 0]
Expand Down Expand Up @@ -35,10 +34,10 @@
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: BSD License'
])
16 changes: 11 additions & 5 deletions tests/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import pathlib
import pickle
import re
import rstcheck
import shutil
import sqlite3
import subprocess
import tempfile
import time
import unittest
Expand Down Expand Up @@ -164,6 +164,7 @@ def test_version_loaded(self):
"""TaskGraph: verify we can load the version."""
try:
import taskgraph

# Verifies that there's a version attribute and it has a value.
self.assertTrue(len(taskgraph.__version__) > 0)
except Exception:
Expand Down Expand Up @@ -432,10 +433,12 @@ def test_task_chain_single_thread(self):
# was a duplicate
database_path = os.path.join(
self.workspace_dir, taskgraph._TASKGRAPH_DATABASE_FILENAME)
with sqlite3.connect(database_path) as conn:
conn = sqlite3.connect(database_path)
with conn:
cursor = conn.cursor()
cursor.execute("SELECT * FROM taskgraph_data")
result = cursor.fetchall()
conn.close()
self.assertEqual(len(result), 4)

def test_task_broken_chain(self):
Expand Down Expand Up @@ -526,10 +529,13 @@ def test_empty_task(self):
# we shouldn't have anything in the database
database_path = os.path.join(
self.workspace_dir, taskgraph._TASKGRAPH_DATABASE_FILENAME)
with sqlite3.connect(database_path) as conn:

conn = sqlite3.connect(database_path)
with conn:
cursor = conn.cursor()
cursor.executescript("SELECT * FROM taskgraph_data")
result = cursor.fetchall()
conn.close()
self.assertEqual(len(result), 0)

def test_closed_graph(self):
Expand Down Expand Up @@ -899,6 +905,7 @@ def test_unix_path_repeated_function(self):
def test_very_long_string(self):
"""TaskGraph: ensure that long strings don't case an OSError."""
from taskgraph.Task import _get_file_stats

# this is a list with two super long strings to try to trick some
# os function into thinking it's a path.
base_value = [
Expand Down Expand Up @@ -1441,8 +1448,7 @@ def test_history_rst_format(self):
# ensure there are no errors when checking the history file
history_filepath = os.path.join(
os.path.dirname(__file__), '..', 'HISTORY.rst')
self.assertEqual(
list(rstcheck.check(open(history_filepath, 'r').read())), [])
subprocess.check_call(['rstcheck', history_filepath])

def test_mtime_mismatch(self):
"""TaskGraph: ensure re-run when file mtimes don't match.
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = {py36,py37,py38,py39,py310}-{base,psutil}
envlist = {py37,py38,py39,py310,py311}-{base,psutil}

[gh-actions]
# Allows us to use tox configuration to manage our tests, but still run on
Expand All @@ -11,6 +11,7 @@ python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[testenv]
commands =
Expand Down

0 comments on commit b8a8d66

Please sign in to comment.