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

Unable to run tests - dependency issue #28

Open
mdavis-xyz opened this issue Nov 30, 2020 · 1 comment · May be fixed by #29
Open

Unable to run tests - dependency issue #28

mdavis-xyz opened this issue Nov 30, 2020 · 1 comment · May be fixed by #29

Comments

@mdavis-xyz
Copy link

I'm trying to run the unit tests, so that I can write a PR.

I can't figure out how. There's no requirements.txt or requirements_test.txt.

setup.py only specifies Flask as a dependency, and no test dependencies.

If I install Flask and run python3 setup.py test, it says:

ModuleNotFoundError: No module named 'flask.ext'

So are the dependencies in setup.py missing something? What do I pip install? Flask-Ext? That library has 1 contributor, no stars, no forks, no issues. Is that the right one?

@sandrotosi
Copy link

i think there has been a code reorg at some point (from flask.ext.basicauth to flask_basicauth) and not all places have been updated. I'm apply think patch and it seems to do what we expect (anyone can submit a pr with this code, attribution is not important to me):

--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -* coding: utf-8 -*-
 #
 # Flask-BasicAuth documentation build configuration file, created by
 # sphinx-quickstart on Sun Apr 29 21:12:20 2012.
@@ -13,7 +13,7 @@
 
 import sys, os
 
-from flask.ext.basicauth import __version__
+from flask_basicauth import __version__
 
 # 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
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -22,7 +22,7 @@ Usage
 Usage of Flask-BasicAuth is simple::
 
     from flask import Flask, render_template
-    from flask.ext.basicauth import BasicAuth
+    from flask_basicauth import BasicAuth
 
     app = Flask(__name__)
 
@@ -77,14 +77,14 @@ A list of configuration keys currently u
     The correct username and password combination that grants access for the
     client to the protected resource.
 
-    You can override :meth:`BasicAuth.check_credentials <flask.ext.basicauth.BasicAuth.check_credentials>`,
+    You can override :meth:`BasicAuth.check_credentials <flask_basicauth.BasicAuth.check_credentials>`,
     if you need a different authentication logic for your application.
 
 
 API reference
 -------------
 
-.. module:: flask.ext.basicauth
+.. module:: flask_basicauth
 
 This part of the documentation covers all the public classes and functions
 in Flask-BasicAuth.
--- a/flask_basicauth.py
+++ b/flask_basicauth.py
@@ -1,5 +1,5 @@
 """
-    flask.ext.basicauth
+    flask_basicauth
     ~~~~~~~~~~~~~~~~~~~
 
     Flask-BasicAuth is a Flask extension that provides an easy way to protect
--- a/test_basicauth.py
+++ b/test_basicauth.py
@@ -2,7 +2,7 @@ import base64
 import unittest
 
 from flask import Flask
-from flask.ext.basicauth import BasicAuth
+from flask_basicauth import BasicAuth
 
 
 class BasicAuthTestCase(unittest.TestCase):

@mdavis-xyz mdavis-xyz linked a pull request Feb 12, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants