Skip to content

Commit c69d0fc

Browse files
Merge pull request #1 from casework/feature/test_in_python_3_6
Test in Python 3.6
2 parents 5d08d60 + e59ea52 commit c69d0fc

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
python-version: [3.8]
26+
python-version: [ 3.6, 3.8 ]
2727

2828
steps:
2929
- uses: actions/checkout@v2
@@ -38,4 +38,4 @@ jobs:
3838
- name: Start from clean state
3939
run: make clean
4040
- name: Run tests
41-
run: make check
41+
run: make PYTHON3=python check

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
SHELL := /bin/bash
1515

16+
PYTHON3 ?= $(shell which python3.9 2>/dev/null || which python3.8 2>/dev/null || which python3.7 2>/dev/null || which python3.6 2>/dev/null || which python3)
17+
1618
all:
1719

1820
.PHONY: \
@@ -38,6 +40,7 @@ all:
3840
check: \
3941
.git_submodule_init.done.log
4042
$(MAKE) \
43+
PYTHON3=$(PYTHON3) \
4144
--directory tests \
4245
check
4346

tests/case_file/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,11 @@ kb.ttl: \
9696
mv _$@ $@
9797

9898
sample.txt.done.log: \
99+
$(tests_srcdir)/.venv.done.log \
99100
sample_txt.py
100-
python3 sample_txt.py sample.txt
101+
source $(tests_srcdir)/venv/bin/activate \
102+
&& python3 sample_txt.py \
103+
sample.txt
101104
touch $@
102105

103106
# Display difference between rdflib default output and compacted output.

tests/case_file/sample_txt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
Mtime should be 2010-01-02T03:04:56Z.
1818
"""
1919

20-
import datetime
2120
import os
2221
import sys
2322

23+
import dateutil.parser
24+
2425
with open(sys.argv[1], "w") as out_fh:
2526
out_fh.write("test")
2627

27-
target_datetime = datetime.datetime.fromisoformat("2010-01-02T03:04:56+00:00")
28+
target_datetime = dateutil.parser.isoparse("2010-01-02T03:04:56+00:00")
2829
target_timestamp = target_datetime.timestamp()
2930
os.utime(sys.argv[1], (target_timestamp, target_timestamp))

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
PyLD
22
pytest
3+
python-dateutil

0 commit comments

Comments
 (0)