[damned-lies] feat: build damned_lies package using setuptools



commit cbe25faab14bae37064c88ee0454800f11d02615
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date:   Mon May 9 15:06:22 2022 +0200

    feat: build damned_lies package using setuptools

 .gitignore     |  8 ++++++++
 MANIFEST.in    | 10 ++++++++++
 pyproject.toml |  3 +++
 setup.cfg      | 22 ++++++++++++++++++++++
 setup.py       | 31 +++++++++++++++++++++++++++++++
 5 files changed, 74 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index 70ebbe3d..5c2cf044 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,14 @@ damnedlies/local_settings.py
 /media
 /static
 
+# Build artifacts
+*.egg-info
+dist
+
+# Automatically created directories by tests
+scratch
+data
+
 # Coverage package
 .coverage
 coverage_html_report
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 00000000..bb8aada4
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,10 @@
+include damned-lies.doap
+include requirements.txt
+
+include COPYING
+include AUTHORS
+include README.md
+
+recursive-include templates *
+recursive-include po *
+recursive-include common/static *
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..fa7093a3
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools>=42"]
+build-backend = "setuptools.build_meta"
\ No newline at end of file
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 00000000..0128855d
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,22 @@
+[metadata]
+name = damned-lies
+author = GNOME Damned Lies Contributors
+author_email = gbernard gnome org
+description = The GNOME Damned Lies Translation Platform is the Web tool that is used by translators to 
coordinate their translation effort across multiple projects and modules.
+long_description = file:README.md
+long_description_content_type = text/markdown
+url = https://gitlab.gnome.org/Infrastructure/damned-lies/
+project_urls =
+       Bug Tracker = https://gitlab.gnome.org/Infrastructure/damned-lies/-/issues
+classifiers =
+    Environment :: Web Environment
+    Framework :: Django :: 4.0
+    License :: OSI Approved :: GNU General Public License v3 (GPLv3)
+    Operating System :: Unix
+    Programming Language :: Python :: 3
+    Topic :: Desktop Environment :: Gnome
+    Topic :: Software Development :: Internationalization
+    Topic :: Software Development :: Localization
+
+[options]
+include_package_data = True
diff --git a/setup.py b/setup.py
new file mode 100755
index 00000000..080528a1
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+
+import os
+import re
+from typing import List
+
+from datetime import datetime
+
+from setuptools import setup
+
+# allow setup.py to be run from any path
+os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
+
+
+def get_requirements() -> List[str]:
+    req = list()
+    with open("./requirements.txt") as requirements:
+        pattern = re.compile(r"^.*#egg=([\w]+)$")
+        for line in requirements.read().splitlines():
+            if pattern.match(line):
+                req.append(pattern.findall(line)[0])
+            else:
+                req.append(line)
+    return req
+
+
+setup(
+    version=datetime.utcnow().strftime('%Y%m%d%H%M'),
+    packages=["."],
+    install_requires=get_requirements(),
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]