aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-03-02 15:50:11 +0300
committerFrederick Muriuki Muriithi2024-03-02 15:50:11 +0300
commitcd6eebd85d32feb289ccecd1aee45fb40b03d77f (patch)
treeb6fceca55105600657059e959b40d80cc1e21957
parent8a20071dc8009b5b9439d10e17a2a57883b7b363 (diff)
downloadgn-auth-cd6eebd85d32feb289ccecd1aee45fb40b03d77f.tar.gz
Use `find_packages()` and include static files and templates.
-rw-r--r--MANIFEST.in2
-rwxr-xr-xsetup.py19
2 files changed, 11 insertions, 10 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..ea5197f
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+global-include static/**/*.js static/**/*.css templates/**/*.html
+global-exclude *~ *.py[cod] \ No newline at end of file
diff --git a/setup.py b/setup.py
index acf5fee..10848df 100755
--- a/setup.py
+++ b/setup.py
@@ -2,22 +2,14 @@
"""Setup script for GeneNetwork Auth package."""
import glob
from pathlib import Path
-from setuptools import setup
from setup_commands import RunTests
+from setuptools import setup, find_packages
LONG_DESCRIPTION = """
gn-auth project is the authentication/authorisation server to be used
across all GeneNetwork services.
"""
-def get_packages(dir_path):
- "get package relative to name of directory"
- dir_name = Path(dir_path).absolute().name
- return list(".".join(path) for path in
- (path[0:-1] for path in
- (path.split("/") for path in
- glob.glob(f"{dir_name}/**/__init__.py", recursive=True))))
-
setup(author="Frederick M. Muriithi",
author_email="fredmanglis@gmail.com",
description=(
@@ -37,12 +29,19 @@ setup(author="Frederick M. Muriithi",
"xapian-bindings"
],
include_package_data=True,
+ packages=find_packages(
+ where=".",
+ exclude=(
+ "tests",
+ "tests.*",
+ "setup_commands",
+ "setup_commands.*")),
+ # `package_data` doesn't seem to work. Use MANIFEST.in instead
scripts=[],
license="AGPLV3",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
name="gn-auth",
- packages = get_packages("./gn_auth") + get_packages("./migrations"),
url="https://github.com/genenetwork/gn-auth",
version="0.0.1",
tests_require=["pytest", "hypothesis"],