Skip to content
Snippets Groups Projects
Commit 372789b2 authored by E. Madison Bray's avatar E. Madison Bray
Browse files

[refactoring][#1] initial package structure for renewal_recsystem

parent 57923aa7
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,9 @@ dist/
.cache
pip-wheel-metadata
# Other generated files
renewal_recsystem/_version.py
# Generic
## Vim
*.sw[opn]
.root 0 → 100644
# Used with setuptools_scm to determine whether we are in the root of the
# package's source repository; do not remove.
0bed75b622cc0ba48e0bf4cb56b5108098ed362b
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
[tool.setuptools_scm]
local_scheme = "node-and-timestamp"
write_to = "renewal_recsystem/_version.py"
from .version import version as __version__
"""
Determine the package version.
`setuptools_scm` is used programmatically only if we are in the source
repository as determined by the presence of a ``.root`` file containing
a specific hard-coded string.
Otherwise the statically generated version from ``_version.py`` is used.
"""
import pathlib
root_magic = '0bed75b622cc0ba48e0bf4cb56b5108098ed362b' # randomly generated
root_file = pathlib.Path(__file__).parent.parent / '.root'
use_setuptools_scm = False
if root_file.is_file():
with root_file.open() as f:
for line in f:
if line.startswith('#'):
continue
elif line.rstrip() == root_magic:
try:
import setuptools_scm
use_setuptools_scm = True
except ImportError:
pass
break
if use_setuptools_scm:
version = setuptools_scm.get_version(root='..', relative_to=__file__)
else:
try:
from ._version import version
except ImportError:
import warnings
warnings.warn(
f'could not determine package version of {__package__}; this '
f'suggests a broken installation')
version = '0.0.0'
[metadata]
name = renewal-recsystem
description = Base impementation for Renewal recommendation systems in Python
long_description = file: README.md
author = E. Madison Bray
author_email = embray@lri.fr
url = https://gitlri.lri.fr/renewal/recsystems
[options]
python_requires = >= 3.7
packages = find:
setup_requires = setuptools_scm
[tool:pytest]
addopts =
--doctest-modules
doctest_optionflags = ELLIPSIS
filterwarnings =
# ignore warning from pkg_resources' vendored copy of pyparsing
ignore:Using or importing the ABCs from 'collections'
setup.py 0 → 100644
#!/usr/bin/env python
"""
A minimal ``setup.py`` is still required when using setuptools.
See ``setup.cfg`` for package configuration.
"""
from setuptools import setup
setup(user_scm_version={
'local_scheme': 'node-and-timestamp',
'write_to': 'renewal_recsys/_version.py'
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment