Skip to content

Commit

Permalink
Migrate to Flask 2.x (#2154)
Browse files Browse the repository at this point in the history
* Migrate to Flask 2.x

* new line length

* fixes

* fixes
  • Loading branch information
berggren committed Apr 6, 2022
1 parent b099d1a commit 5be87c7
Show file tree
Hide file tree
Showing 7 changed files with 596 additions and 906 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Expand Up @@ -384,7 +384,7 @@ indent-string=' '

# Maximum number of characters on a single line.
# max-line-length=100
max-line-length=80
max-line-length=88

# Maximum number of lines in a module.
max-module-lines=1000
Expand Down
2 changes: 1 addition & 1 deletion docker/e2e/docker-entrypoint.sh
Expand Up @@ -59,7 +59,7 @@ if [ "$1" = 'timesketch' ]; then

# Sleep to allow the other processes to start
sleep 5
tsctl add_user --username "$TIMESKETCH_USER" --password "$TIMESKETCH_PASSWORD"
tsctl create-user "$TIMESKETCH_USER" --password "$TIMESKETCH_PASSWORD"
unset TIMESKETCH_PASSWORD

cat <<EOF >> /etc/timesketch/data_finder.yaml
Expand Down
9 changes: 4 additions & 5 deletions requirements.txt
Expand Up @@ -4,14 +4,13 @@ celery==4.4.0
cryptography==3.3.2
datasketch==1.5.0
opensearch-py==1.0.0
Flask==1.1.1
Flask==2.0.3
flask_bcrypt==0.7.1
flask_login==0.4.1
flask_migrate==2.5.2
flask_restful==0.3.7
flask_script==2.0.6
flask_restful==0.3.9
flask_sqlalchemy==2.4.1
flask_wtf==0.14.2
flask_wtf==1.0.0
google-auth==1.7.0
google_auth_oauthlib==0.4.1
gunicorn==19.10.0 # Note: Last version to support py2
Expand All @@ -26,7 +25,7 @@ requests==2.25.1
sigmatools==0.19.1 ; python_version > '3.4'
six==1.12.0
SQLAlchemy==1.3.12
Werkzeug==0.16.0
Werkzeug==2.0.3
WTForms==2.2.1
xlrd==1.2.0
tabulate==0.8.6
Expand Down
54 changes: 27 additions & 27 deletions setup.py
Expand Up @@ -35,9 +35,11 @@

version_tuple = (sys.version_info[0], sys.version_info[1])
if version_tuple < (3, 6):
print((
'Unsupported Python version: {0:s}, version 3.6 or higher '
'required.').format(sys.version))
print(
(
"Unsupported Python version: {0:s}, version 3.6 or higher " "required."
).format(sys.version)
)
sys.exit(1)


Expand All @@ -50,7 +52,7 @@ def parse_requirements_from_file(path):
Yields:
str: package resource requirement.
"""
with open(path, 'r') as file_object:
with open(path, "r") as file_object:
file_contents = file_object.read()
for req in pkg_resources.parse_requirements(file_contents):
try:
Expand All @@ -61,38 +63,36 @@ def parse_requirements_from_file(path):


timesketch_description = (
'Timesketch is a web based tool for collaborative forensic timeline '
'analysis. Using sketches you and your collaborators can easily organize '
'timelines and analyze them all at the same time. Add meaning to '
'your raw data with rich annotations, comments, tags and stars.')
"Timesketch is a web based tool for collaborative forensic timeline "
"analysis. Using sketches you and your collaborators can easily organize "
"timelines and analyze them all at the same time. Add meaning to "
"your raw data with rich annotations, comments, tags and stars."
)

setup(
name='timesketch',
name="timesketch",
version=version.get_version(),
description='Digital forensic timeline analysis',
description="Digital forensic timeline analysis",
long_description=timesketch_description,
license='Apache License, Version 2.0',
url='http://www.timesketch.org/',
maintainer='Timesketch development team',
maintainer_email='timesketch-dev@googlegroups.com',
license="Apache License, Version 2.0",
url="http://www.timesketch.org/",
maintainer="Timesketch development team",
maintainer_email="timesketch-dev@googlegroups.com",
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Operating System :: OS Independent',
'Programming Language :: Python',
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Operating System :: OS Independent",
"Programming Language :: Python",
],
data_files=[
('share/timesketch', glob.glob(
os.path.join('data', '*.*'))),
('share/timesketch/linux', glob.glob(
os.path.join('data', 'linux', '*.*'))),
('share/doc/timesketch', [
'AUTHORS', 'LICENSE', 'README.md']),
("share/timesketch", glob.glob(os.path.join("data", "*.*"))),
("share/timesketch/linux", glob.glob(os.path.join("data", "linux", "*.*"))),
("share/doc/timesketch", ["AUTHORS", "LICENSE", "README.md"]),
],
packages=find_packages(),
include_package_data=True,
zip_safe=False,
entry_points={'console_scripts': ['tsctl=timesketch.tsctl:main']},
install_requires=parse_requirements_from_file('requirements.txt'),
tests_require=parse_requirements_from_file('test_requirements.txt'),
entry_points={"console_scripts": ["tsctl=timesketch.tsctl:cli"]},
install_requires=parse_requirements_from_file("requirements.txt"),
tests_require=parse_requirements_from_file("test_requirements.txt"),
)

0 comments on commit 5be87c7

Please sign in to comment.