Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.7 version bump, python 3.12 support #52

Merged
merged 2 commits into from
Mar 9, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: ubuntu-20.04
python-version: "3.7"
Expand Down
2 changes: 1 addition & 1 deletion copydetect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.4.6"
__version__ = "0.4.7"

from .detector import CopyDetector, CodeFingerprint, compare_files
Empty file added copydetect/data/__init__.py
Empty file.
8 changes: 5 additions & 3 deletions copydetect/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import time
import logging
import webbrowser
import pkg_resources
import importlib.resources
import io
import base64
import json
Expand All @@ -17,6 +17,7 @@
import matplotlib.pyplot as plt
from jinja2 import Template

import copydetect.data as data_files
from .utils import (filter_code, highlight_overlap, get_copied_slices,
get_document_fingerprints, find_fingerprint_overlap,
get_token_coverage)
Expand Down Expand Up @@ -541,7 +542,6 @@ def generate_html_report(self, output_mode="save"):
return

code_list = self.get_copied_code_list()
data_dir = pkg_resources.resource_filename('copydetect', 'data/')

plot_mtx = np.copy(self.similarity_matrix[:,:,0])
plot_mtx[plot_mtx == -1] = np.nan
Expand All @@ -564,7 +564,9 @@ def generate_html_report(self, output_mode="save"):
plt.close()

# render template with jinja and save as html
with open(data_dir + "report.html", encoding="utf-8") as template_fp:
with importlib.resources.open_text(
data_files, "report.html", encoding="utf-8"
) as template_fp:
template = Template(template_fp.read())

flagged = self.similarity_matrix[:,:,0] > self.conf.display_t
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
setup(name="copydetect",
author="Bryson Lingenfelter",
author_email="[email protected]",
version="0.4.5",
version="0.4.7",
description="Code plagiarism detection tool",
long_description=readme,
long_description_content_type="text/markdown",
Expand All @@ -30,6 +30,8 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
Expand Down
Loading