-
Notifications
You must be signed in to change notification settings - Fork 17
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 #93 from CarliJoy/chore
Chore: some little fixups
- Loading branch information
Showing
6 changed files
with
25 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
#!/usr/bin/env python | ||
"""Django's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RoWoOekostromDB.settings") | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
# This file seems to be required for pytest-django to work properly |
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,12 +1,10 @@ | ||
from pkg_resources import DistributionNotFound, get_distribution | ||
from importlib.metadata import PackageNotFoundError, version | ||
|
||
try: | ||
# Change here if project is renamed and does not equal the package name | ||
dist_name = "django-pint" | ||
__version__ = get_distribution(dist_name).version | ||
except DistributionNotFound: # pragma: no cover | ||
# We don't expect this to be executed, as this would mean the configuration | ||
# for the python module is wrong | ||
__version__ = version(dist_name) | ||
except PackageNotFoundError: # pragma: no cover | ||
__version__ = "unknown" | ||
finally: | ||
del get_distribution, DistributionNotFound | ||
del version, PackageNotFoundError |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import django_pint | ||
import quantityfield | ||
|
||
|
||
def test_version_import_quantityfield() -> None: | ||
"""The quantityfield version is a defined version""" | ||
assert quantityfield.__version__ != "unknown" | ||
assert quantityfield.__version__[0].isnumeric() | ||
|
||
|
||
def test_version_import_django_pint() -> None: | ||
"""The django_pint version is a defined version""" | ||
assert django_pint.__version__ != "unknown" | ||
assert django_pint.__version__[0].isnumeric() |