-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
71 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
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,16 @@ | ||
import os | ||
|
||
|
||
def local_scheme(version): | ||
return "" | ||
|
||
|
||
def get_version(): | ||
from setuptools_scm import get_version as default_version | ||
|
||
github_version = os.environ.get("GITHUB_REF_NAME", None) | ||
github_type = os.environ.get("GITHUB_REF_TYPE", None) | ||
if github_version is not None and github_type == "tag": | ||
print(f"GITHUB_REF_NAME found, using version: {github_version}") | ||
return github_version | ||
return default_version(local_scheme=local_scheme) |
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,46 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.4"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "modoboa-radicale" | ||
dynamic = [ | ||
"version", | ||
"dependencies", | ||
"optional-dependencies" | ||
] | ||
authors = [ | ||
{ name="Antoine Nguyen", email="[email protected]" }, | ||
] | ||
description = "The Radicale frontend of Modoboa" | ||
readme = "README.rst" | ||
requires-python = ">=3.9" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Framework :: Django :: 4.2", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: ISC License (ISCL)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Communications :: Email", | ||
"Topic :: Internet :: WWW/HTTP", | ||
] | ||
keywords = ["modoboa", "email", "radicale", "calendar", "caldav"] | ||
license = {file = "LICENSE"} | ||
|
||
[project.urls] | ||
Homepage = "https://modoboa.org/" | ||
Documentation = "https://modoboa.readthedocs.io/en/latest/" | ||
Repository = "https://github.com/modoboa/modoboa-radicale" | ||
Changelog = "https://github.com/modoboa/modoboa-radicale/blob/master/CHANGELOG.md" | ||
Issues = "https://github.com/modoboa/modoboa-radicale/issues" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "modoboa_radicale.version.get_version"} | ||
dependencies = {file = ["requirements.txt"]} | ||
optional-dependencies.test = { file = ["test-requirements.txt"] } |
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 |
---|---|---|
|
@@ -8,38 +8,10 @@ | |
https://packaging.python.org/en/latest/distributing.html | ||
""" | ||
|
||
import io | ||
from os import path | ||
|
||
try: | ||
from pip.req import parse_requirements | ||
except ImportError: | ||
# pip >= 10 | ||
from pip._internal.req import parse_requirements | ||
|
||
from setuptools import setup, find_packages | ||
|
||
|
||
def get_requirements(requirements_file): | ||
"""Use pip to parse requirements file.""" | ||
requirements = [] | ||
dependencies = [] | ||
if path.isfile(requirements_file): | ||
for req in parse_requirements(requirements_file, session="hack"): | ||
try: | ||
# check markers, such as | ||
# | ||
# rope_py3k ; python_version >= '3.0' | ||
# | ||
if req.match_markers(): | ||
requirements.append(str(req.req)) | ||
if req.link: | ||
dependencies.append(str(req.link)) | ||
except AttributeError: | ||
requirements.append(req.requirement) | ||
return requirements, dependencies | ||
|
||
|
||
def local_scheme(version): | ||
""" | ||
Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2) | ||
|
@@ -50,41 +22,14 @@ def local_scheme(version): | |
|
||
if __name__ == "__main__": | ||
HERE = path.abspath(path.dirname(__file__)) | ||
INSTALL_REQUIRES, DEPENDENCY_LINKS = ( | ||
get_requirements(path.join(HERE, "requirements.txt"))) | ||
|
||
with io.open(path.join(HERE, "README.rst"), encoding="utf-8") as readme: | ||
with open(path.join(HERE, "README.rst"), encoding="utf-8") as readme: | ||
LONG_DESCRIPTION = readme.read() | ||
|
||
setup( | ||
name="modoboa-radicale", | ||
description="The Radicale frontend of Modoboa", | ||
long_description=LONG_DESCRIPTION, | ||
license="MIT", | ||
url="http://modoboa.org/", | ||
author="Antoine Nguyen", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Framework :: Django :: 2.2", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Communications :: Email", | ||
"Topic :: Internet :: WWW/HTTP", | ||
], | ||
keywords="modoboa email radicale calendar caldav", | ||
packages=find_packages(exclude=["docs", "test_project"]), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=INSTALL_REQUIRES, | ||
dependency_links=DEPENDENCY_LINKS, | ||
use_scm_version={"local_scheme": local_scheme}, | ||
setup_requires=["setuptools_scm"], | ||
) |
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