File: manage.py

package info (click to toggle)
djangorestframework-filters 1.0.0.dev2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 420 kB
  • sloc: python: 2,855; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
import os
import sys

# Remove the package root directory from `sys.path`, ensuring that rest_framework_filters
# is imported from the installed site packages. Used for testing the distribution.
if '--no-pkgroot' in sys.argv:
    sys.argv.remove('--no-pkgroot')
    package_root = sys.path.pop(0)

    import rest_framework_filters
    package_dir = os.path.join(os.getcwd(), 'rest_framework_filters')
    assert not rest_framework_filters.__file__.startswith(package_dir)

    sys.path.insert(0, package_root)


if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)