diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..791490d3a --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade +upgrade: + pip install -q -r requirements/pip_tools.txt + pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in + pip-compile --upgrade -o requirements/base.txt requirements/base.in + pip-compile --upgrade -o requirements/docs.txt requirements/docs.in diff --git a/openedx.yaml b/openedx.yaml index 69b973180..44b38b82d 100644 --- a/openedx.yaml +++ b/openedx.yaml @@ -9,3 +9,4 @@ tags: - library oeps: oep-7: True + oep-18: True diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b89deada3..000000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -django>=1.8,<2.0 -Markdown>=2.6,<2.7 -django-sekizai>=0.10 -django-mptt>=0.8.6,<0.9 -sorl-thumbnail>=12,<13 -six>=1.10.0,<2.0.0 -bleach==2.1.4 diff --git a/requirements/base.in b/requirements/base.in new file mode 100644 index 000000000..bb1d13c64 --- /dev/null +++ b/requirements/base.in @@ -0,0 +1,10 @@ +# Core requirements for using this package +-c constraints.txt + +bleach # Use for sanitizing HTML content in wiki articles +django +django-mptt +django-sekizai +Markdown +six # Use for strings and unicode compatibility +sorl-thumbnail # Required by wiki.plugins.images diff --git a/requirements/base.txt b/requirements/base.txt new file mode 100644 index 000000000..638118252 --- /dev/null +++ b/requirements/base.txt @@ -0,0 +1,20 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# make upgrade +# +bleach==3.1.5 # via -r requirements/base.in +django-classy-tags==1.0.0 # via django-sekizai +django-js-asset==1.2.2 # via django-mptt +django-mptt==0.11.0 # via -r requirements/base.in +django-sekizai==1.1.0 # via -r requirements/base.in +django==2.2.13 # via -c requirements/constraints.txt, -r requirements/base.in, django-classy-tags, django-mptt, django-sekizai +markdown==2.6.11 # via -c requirements/constraints.txt, -r requirements/base.in +packaging==20.4 # via bleach +pyparsing==2.4.7 # via packaging +pytz==2020.1 # via django +six==1.15.0 # via -r requirements/base.in, bleach, django-classy-tags, django-sekizai, packaging +sorl-thumbnail==12.6.3 # via -r requirements/base.in +sqlparse==0.3.1 # via django +webencodings==0.5.1 # via bleach diff --git a/requirements/constraints.txt b/requirements/constraints.txt new file mode 100644 index 000000000..e5853f8af --- /dev/null +++ b/requirements/constraints.txt @@ -0,0 +1,17 @@ +# Version constraints for pip-installation. +# +# This file doesn't install any packages. It specifies version constraints +# that will be applied if a package is needed. +# +# When pinning something here, please provide an explanation of why. Ideally, +# link to other information that will help people in the future to remove the +# pin when possible. Writing an issue against the offending project and +# linking to it here is good. + +# TODO: Many pinned dependencies should be unpinned and/or moved to this constraints file. + +# Use latest Django LTS version +Django<2.3.0 + +# Use version 2.6 to avoid markdown errors +Markdown<2.7 diff --git a/requirements/docs.in b/requirements/docs.in new file mode 100644 index 000000000..832d305e3 --- /dev/null +++ b/requirements/docs.in @@ -0,0 +1,5 @@ +# Used by doc builds (like for edx.readthedocs.io) +-c constraints.txt + +edx-sphinx-theme +Sphinx diff --git a/requirements/docs.txt b/requirements/docs.txt new file mode 100644 index 000000000..34bc60738 --- /dev/null +++ b/requirements/docs.txt @@ -0,0 +1,34 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# make upgrade +# +alabaster==0.7.12 # via sphinx +babel==2.8.0 # via sphinx +certifi==2020.6.20 # via requests +chardet==3.0.4 # via requests +docutils==0.16 # via sphinx +edx-sphinx-theme==1.5.0 # via -r requirements/docs.in +idna==2.10 # via requests +imagesize==1.2.0 # via sphinx +jinja2==2.11.2 # via sphinx +markupsafe==1.1.1 # via jinja2 +packaging==20.4 # via sphinx +pygments==2.6.1 # via sphinx +pyparsing==2.4.7 # via packaging +pytz==2020.1 # via babel +requests==2.24.0 # via sphinx +six==1.15.0 # via edx-sphinx-theme, packaging +snowballstemmer==2.0.0 # via sphinx +sphinx==3.1.1 # via -r requirements/docs.in, edx-sphinx-theme +sphinxcontrib-applehelp==1.0.2 # via sphinx +sphinxcontrib-devhelp==1.0.2 # via sphinx +sphinxcontrib-htmlhelp==1.0.3 # via sphinx +sphinxcontrib-jsmath==1.0.1 # via sphinx +sphinxcontrib-qthelp==1.0.3 # via sphinx +sphinxcontrib-serializinghtml==1.1.4 # via sphinx +urllib3==1.25.9 # via requests + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/pip_tools.in b/requirements/pip_tools.in new file mode 100644 index 000000000..b10701838 --- /dev/null +++ b/requirements/pip_tools.in @@ -0,0 +1,3 @@ +# Dependencies to run compile tools +-c constraints.txt +pip-tools # Contains pip-compile, used to generate pip requirements files diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt new file mode 100644 index 000000000..279019f74 --- /dev/null +++ b/requirements/pip_tools.txt @@ -0,0 +1,12 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# make upgrade +# +click==7.1.2 # via pip-tools +pip-tools==5.2.1 # via -r requirements/pip_tools.in +six==1.15.0 # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip diff --git a/setup.py b/setup.py index f6aa01561..2db1eeec5 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,29 @@ def build_media_pattern(base_folder, file_extension): return ["%s/%s*.%s" % (base_folder, "*/"*x, file_extension) for x in range(10)] +def load_requirements(*requirements_paths): + """ + Load all requirements from the specified requirements files. + Returns a list of requirement strings. + """ + requirements = set() + for path in requirements_paths: + with open(path) as reqs: + requirements.update( + line.split('#')[0].strip() for line in reqs + if is_requirement(line.strip()) + ) + return list(requirements) + + +def is_requirement(line): + """ + Return True if the requirement line is a package requirement; + that is, it is not blank, a comment, a URL, or an included file. + """ + return line and not line.startswith(('-r', '#', '-e', 'git+', '-c')) + + template_patterns = ( build_media_pattern("templates", "html") + build_media_pattern("static", "js") + @@ -38,22 +61,17 @@ def build_media_pattern(base_folder, file_extension): ) setup( - name = "django-wiki", + name="django-wiki", version="0.0.27", author="Benjamin Bach", author_email="benjamin@overtag.dk", description=("A wiki system written for the Django framework."), license="GPLv3", keywords="django wiki markdown", - packages=find_packages(exclude=["testproject","testproject.*"]), + packages=find_packages(exclude=["testproject", "testproject.*"]), long_description=read('README.md'), zip_safe=False, - install_requires=[ - 'Django<3.0', - 'markdown', - 'django-sekizai', - 'django-mptt', - ], + install_requires=load_requirements('requirements/base.in'), classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'License :: OSI Approved :: GPLv3', @@ -65,6 +83,9 @@ def build_media_pattern(base_folder, file_extension): 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.8', + 'Framework :: Django', + 'Framework :: Django :: 2.2', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries :: Application Frameworks',