-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from eduNEXT/eric/oep-18
[BD-6] Compliance with OEP-18
- Loading branch information
Showing
22 changed files
with
246 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
oeps: | ||
oep-7: true | ||
oep-18: false | ||
oep-18: true | ||
|
||
tags: | ||
- library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Core requirements for using this package | ||
-c constraints.txt | ||
|
||
Click |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# | ||
# make upgrade | ||
# | ||
click==7.1.2 # via -r requirements/base.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
# mock version 4.0.0 drops support for python 3.5 | ||
mock<4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Dependencies for building documentation | ||
|
||
-r base.in # Core dependencies | ||
|
||
Sphinx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.4.5.1 # via requests | ||
chardet==3.0.4 # via requests | ||
click==7.1.2 # via -r requirements/base.in | ||
docutils==0.16 # via sphinx | ||
idna==2.9 # via requests | ||
imagesize==1.2.0 # via sphinx | ||
jinja2==2.11.2 # via sphinx | ||
markupsafe==1.1.1 # via jinja2 | ||
packaging==20.3 # via sphinx | ||
pygments==2.6.1 # via sphinx | ||
pyparsing==2.4.7 # via packaging | ||
pytz==2020.1 # via babel | ||
requests==2.23.0 # via sphinx | ||
six==1.14.0 # via packaging | ||
snowballstemmer==2.0.0 # via sphinx | ||
sphinx==3.0.3 # via -r requirements/doc.in | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Dependencies to run compile tools | ||
-c constraints.txt | ||
|
||
pip-tools # Contains pip-compile, used to generate pip requirements files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.1.2 # via -r requirements/pip_tools.in | ||
six==1.14.0 # via pip-tools | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Requirements for test runs | ||
-c constraints.txt | ||
|
||
-r base.txt # Core dependencies for the cookiecutter | ||
|
||
bumpversion | ||
wheel | ||
watchdog | ||
flake8 | ||
coverage | ||
twine | ||
|
||
pytest | ||
pytest-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# | ||
# make upgrade | ||
# | ||
attrs==19.3.0 # via pytest | ||
bleach==3.1.5 # via readme-renderer | ||
bumpversion==0.5.3 # via -r requirements/test.in | ||
certifi==2020.4.5.1 # via requests | ||
chardet==3.0.4 # via requests | ||
click==7.1.2 # via -r requirements/base.txt | ||
coverage==5.1 # via -r requirements/test.in | ||
docutils==0.16 # via readme-renderer | ||
entrypoints==0.3 # via flake8 | ||
flake8==3.7.9 # via -r requirements/test.in | ||
idna==2.9 # via requests | ||
importlib-metadata==1.6.0 # via pluggy, pytest | ||
mccabe==0.6.1 # via flake8 | ||
more-itertools==8.2.0 # via pytest | ||
packaging==20.3 # via bleach, pytest | ||
pathlib2==2.3.5 # via pytest | ||
pathtools==0.1.2 # via watchdog | ||
pkginfo==1.5.0.1 # via twine | ||
pluggy==0.13.1 # via pytest | ||
py==1.8.1 # via pytest | ||
pycodestyle==2.5.0 # via flake8 | ||
pyflakes==2.1.1 # via flake8 | ||
pygments==2.6.1 # via readme-renderer | ||
pyparsing==2.4.7 # via packaging | ||
pytest-runner==5.2 # via -r requirements/test.in | ||
pytest==5.4.1 # via -r requirements/test.in | ||
readme-renderer==26.0 # via twine | ||
requests-toolbelt==0.9.1 # via twine | ||
requests==2.23.0 # via requests-toolbelt, twine | ||
six==1.14.0 # via bleach, packaging, pathlib2, readme-renderer | ||
tqdm==4.46.0 # via twine | ||
twine==1.15.0 # via -r requirements/test.in | ||
urllib3==1.25.9 # via requests | ||
watchdog==0.10.2 # via -r requirements/test.in | ||
wcwidth==0.1.9 # via pytest | ||
webencodings==0.5.1 # via bleach | ||
wheel==0.34.2 # via -r requirements/test.in | ||
zipp==1.2.0 # via importlib-metadata | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Used for tests | ||
-c constraints.txt | ||
|
||
tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# | ||
# make upgrade | ||
# | ||
appdirs==1.4.3 # via virtualenv | ||
distlib==0.3.0 # via virtualenv | ||
filelock==3.0.12 # via tox, virtualenv | ||
importlib-metadata==1.6.0 # via importlib-resources, pluggy, tox, virtualenv | ||
importlib-resources==1.5.0 # via virtualenv | ||
packaging==20.3 # via tox | ||
pluggy==0.13.1 # via tox | ||
py==1.8.1 # via tox | ||
pyparsing==2.4.7 # via packaging | ||
six==1.14.0 # via packaging, tox, virtualenv | ||
toml==0.10.0 # via tox | ||
tox==3.15.0 # via -r requirements/tox.in | ||
virtualenv==20.0.20 # via tox | ||
zipp==1.2.0 # via importlib-metadata, importlib-resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Requirements for running tests in Travis | ||
-c constraints.txt | ||
|
||
-r tox.txt | ||
|
||
tox-travis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# | ||
# make upgrade | ||
# | ||
appdirs==1.4.3 # via -r requirements/tox.txt, virtualenv | ||
distlib==0.3.0 # via -r requirements/tox.txt, virtualenv | ||
filelock==3.0.12 # via -r requirements/tox.txt, tox, virtualenv | ||
importlib-metadata==1.6.0 # via -r requirements/tox.txt, importlib-resources, pluggy, tox, virtualenv | ||
importlib-resources==1.5.0 # via -r requirements/tox.txt, virtualenv | ||
packaging==20.3 # via -r requirements/tox.txt, tox | ||
pluggy==0.13.1 # via -r requirements/tox.txt, tox | ||
py==1.8.1 # via -r requirements/tox.txt, tox | ||
pyparsing==2.4.7 # via -r requirements/tox.txt, packaging | ||
six==1.14.0 # via -r requirements/tox.txt, packaging, tox, virtualenv | ||
toml==0.10.0 # via -r requirements/tox.txt, tox | ||
tox-travis==0.12 # via -r requirements/travis.in | ||
tox==3.15.0 # via -r requirements/tox.txt, tox-travis | ||
virtualenv==20.0.20 # via -r requirements/tox.txt, tox | ||
zipp==1.2.0 # via -r requirements/tox.txt, importlib-metadata, importlib-resources |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,28 @@ | |
|
||
test_requirements = ['pytest', ] | ||
|
||
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')) | ||
|
||
setup( | ||
author="edX", | ||
author_email='[email protected]', | ||
|
@@ -25,20 +47,17 @@ | |
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Natural Language :: English', | ||
"Programming Language :: Python :: 2", | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.8', | ||
], | ||
description="User utilities for the Open edX platform", | ||
entry_points={ | ||
'console_scripts': [ | ||
'user_util=user_util.cli:retire_user', | ||
], | ||
}, | ||
install_requires=requirements, | ||
install_requires=load_requirements('requirements/base.in'), | ||
license="GNU General Public License v3", | ||
long_description=readme + '\n\n' + history, | ||
include_package_data=True, | ||
|
@@ -49,6 +68,6 @@ | |
test_suite='tests', | ||
tests_require=test_requirements, | ||
url='https://github.com/edx/user-util', | ||
version='0.1.5', | ||
version='0.2', | ||
zip_safe=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
def test_cli_with_no_options(): | ||
runner = CliRunner() | ||
result_w_no_options = runner.invoke(cli.retire_user) | ||
assert result_w_no_options.exit_code == -1 | ||
assert result_w_no_options.exit_code != 0 | ||
|
||
|
||
def test_cli_help(): | ||
|
@@ -70,7 +70,7 @@ def test_cli_email(): | |
def test_cli_bad_salt(): | ||
runner = CliRunner() | ||
cmd_result = runner.invoke(cli.retire_user, ['-u', 'a_learner', '-e', '[email protected]', '-s', '[]']) | ||
assert cmd_result.exit_code == -1 | ||
assert cmd_result.exit_code != 0 | ||
|
||
# | ||
# Username retirement tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters