Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Upgrade to Django 2.2 LTS #702

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ sudo: false

matrix:
include:
- python: "3.5"
- python: "3.6"
- python: "3.7-dev"
- python: "3.7"
- python: "3.8"
- python: "3.9-dev"
- env:
- BUILD_DOCKER=1
# Variable to add to publish the Docker image:
Expand Down
8 changes: 6 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[packages]
django = "<2.1,>=2.0"
django = ">=2.2,<2.3"
pillow = "*"
coveralls = "*"
dateparser = "*"
Expand All @@ -15,7 +15,6 @@ django-filter = "*"
djangorestframework = "*"
factory-boy = "*"
filemagic = "*"
fuzzywuzzy = {extras = ["speedup"],version = "==0.15.0"}
gunicorn = "*"
inotify-simple = "*"
langdetect = "*"
Expand All @@ -41,3 +40,8 @@ brotli = "*"

[dev-packages]
ipython = "*"
pylint = "*"

[packages.fuzzywuzzy]
extras = [ "speedup",]
version = "==0.15.0"
757 changes: 439 additions & 318 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Believe it or not, this is the officially sanctioned way to add custom CSS.
def setup(app):
app.add_stylesheet("custom.css")
app.add_css_file("custom.css")

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
134 changes: 67 additions & 67 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
-i https://pypi.python.org/simple
alabaster==0.7.12
apipkg==1.5
atomicwrites==1.3.0
attrs==19.1.0
babel==2.7.0
brotli==1.0.7
certifi==2019.6.16
appdirs==1.4.4
attrs==20.2.0
babel==2.8.0
brotli==1.0.9
certifi==2020.6.20
chardet==3.0.4
coverage==4.5.4
coveralls==1.5.1
dateparser==0.7.0
django-cors-headers==2.4.0
django-crispy-forms==1.7.2
django-extensions==2.1.4
django-filter==2.1.0
django==2.0.10
djangoql==0.12.3
djangorestframework==3.9.1
coverage==5.3
coveralls==2.1.2
dateparser==0.7.6
distlib==0.3.1
django-cors-headers==3.5.0
django-crispy-forms==1.9.2
django-extensions==3.0.9
django-filter==2.4.0
django==2.2.16
djangoql==0.14.0
djangorestframework==3.12.1
docopt==0.6.2
docutils==0.15.2
execnet==1.6.1
factory-boy==2.11.1
faker==2.0.0
docutils==0.16
execnet==1.7.1
factory-boy==3.1.0
faker==4.14.0
filelock==3.0.12
filemagic==1.6
fuzzywuzzy[speedup]==0.15.0
fuzzywuzzy==0.15.0
gunicorn==20.0.4
idna==2.8
imagesize==1.1.0
importlib-metadata==0.19
inotify-simple==1.1.8; sys_platform == 'linux'
jinja2==2.10.1
langdetect==1.0.7
idna==2.10
imagesize==1.2.0
importlib-metadata==2.0.0; python_version < '3.8'
iniconfig==1.1.1
inotify-simple==1.3.5
jinja2==2.11.2
langdetect==1.0.8
markupsafe==1.1.1
more-itertools==7.2.0
packaging==19.1
pdftotext==2.1.1
pillow==5.4.1
pluggy==0.12.0
packaging==20.4
pdftotext==2.1.5
pillow==8.0.0
pluggy==0.13.1
ply==3.11
psycopg2==2.8.4
py==1.8.0
pycodestyle==2.4.0
pygments==2.4.2
pyocr==0.5.3
pyparsing==2.4.2
pytest-cov==2.6.1
pytest-django==3.4.5
psycopg2==2.8.6
py==1.9.0
pycodestyle==2.6.0
pygments==2.7.1
pyocr==0.7.2
pyparsing==2.4.7
pytest-cov==2.10.1
pytest-django==4.0.0
pytest-env==0.6.2
pytest-forked==1.0.2
pytest-sugar==0.9.2
pytest-xdist==1.26.0
pytest==4.1.1
python-dateutil==2.7.5
python-dotenv==0.10.1
python-gnupg==0.4.4
pytest-forked==1.3.0
pytest-sugar==0.9.4
pytest-xdist==2.1.0
pytest==6.1.1
python-dateutil==2.8.1
python-dotenv==0.14.0
python-gnupg==0.4.6
python-levenshtein==0.12.0
pytz==2018.9
regex==2019.6.8
requests==2.22.0
six==1.12.0
snowballstemmer==1.9.0
sphinx==1.8.3
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
pytz==2020.1
regex==2020.10.15
requests==2.24.0
six==1.15.0
snowballstemmer==2.0.0
sphinx==3.2.1
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sqlparse==0.4.1
termcolor==1.1.0
text-unidecode==1.2
toml==0.10.0
tox==3.7.0
tzlocal==2.0.0
urllib3==1.25.3
virtualenv==16.7.2
wcwidth==0.1.7
whitenoise==4.1.3
zipp==0.5.2
text-unidecode==1.3
toml==0.10.1
tox==3.20.1
tzlocal==2.1
urllib3==1.25.10
virtualenv==20.0.35
whitenoise==5.2.0
zipp==3.3.1
4 changes: 2 additions & 2 deletions src/documents/management/commands/document_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ class Command(BaseCommand):
help = "A quick & dirty way to see what's in the logs"

def handle(self, *args, **options):
for l in Log.objects.order_by("pk"):
print(l)
for log in Log.objects.order_by("pk"):
print(log)
4 changes: 2 additions & 2 deletions src/documents/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from ..models import Document, Correspondent


class CorrespondentFactory(factory.DjangoModelFactory):
class CorrespondentFactory(factory.django.DjangoModelFactory):

class Meta:
model = Correspondent

name = factory.Faker("name")


class DocumentFactory(factory.DjangoModelFactory):
class DocumentFactory(factory.django.DjangoModelFactory):

class Meta:
model = Document
10 changes: 8 additions & 2 deletions src/paperless_text/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ def create_bg():

def read_text():
with open(self.document_path, 'r') as src:
lines = [l.strip() for l in src.readlines()]
text = "\n".join([l for l in lines[:n_lines]])
lines = []
count = 0
for line in src:
if count >= n_lines:
break
count += 1
Comment on lines +57 to +61
Copy link
Contributor

Choose a reason for hiding this comment

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

Imho better with enumerate

for count, line in enumerate(src, start=1):
  if count >= n_lines:
    break

lines.append(line.strip())
text = "\n".join(lines)
return text.replace('"', "'")

def create_txlayer():
Expand Down