Skip to content

Commit f93915e

Browse files
committed
setup files
1 parent 1898a9d commit f93915e

File tree

5 files changed

+131
-2
lines changed

5 files changed

+131
-2
lines changed

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
torch>=1.6
2+
numpy>=1.16.4

setup.cfg

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[flake8]
2+
# TODO: this should be 88 or 100 according PEP8
3+
max-line-length = 120
4+
exclude = .tox,*.egg,build,temp
5+
select = E,W,F
6+
doctests = True
7+
verbose = 2
8+
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
9+
format = pylint
10+
ignore = E731,W504,F401,F841,E722,W503
11+
12+
[build_sphinx]
13+
source-dir = doc/source
14+
build-dir = doc/build
15+
all_files = 1
16+
17+
[upload_sphinx]
18+
upload-dir = doc/build/html

setup.py

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright The GeoML Team
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
import os
15+
from io import open
16+
17+
from setuptools import setup, find_packages, Command
18+
19+
try:
20+
import builtins
21+
except ImportError:
22+
import __builtin__ as builtins
23+
24+
PATH_ROOT = os.path.dirname(__file__)
25+
builtins.__STOCHMAN_SETUP__ = True
26+
27+
import stochman
28+
29+
30+
class CleanCommand(Command):
31+
"""Custom clean command to tidy up the project root."""
32+
33+
user_options = []
34+
35+
def initialize_options(self):
36+
pass
37+
38+
def finalize_options(self):
39+
pass
40+
41+
def run(self):
42+
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info")
43+
44+
45+
PATH_ROOT = os.path.dirname(__file__)
46+
47+
48+
def load_requirements(path_dir=PATH_ROOT, comment_char="#"):
49+
with open(os.path.join(path_dir, "requirements.txt"), "r") as file:
50+
lines = [ln.strip() for ln in file.readlines()]
51+
reqs = []
52+
for ln in lines:
53+
# filer all comments
54+
if comment_char in ln:
55+
ln = ln[: ln.index(comment_char)]
56+
if ln: # if requirement is not empty
57+
reqs.append(ln)
58+
return reqs
59+
60+
61+
setup(
62+
name="stochman",
63+
version=stochman.__version__,
64+
description=stochman.__docs__,
65+
author=stochman.__author__,
66+
author_email=stochman.__author_email__,
67+
license=stochman.__license__,
68+
packages=find_packages(),
69+
python_requires=">=3.8",
70+
install_requires=load_requirements(PATH_ROOT),
71+
classifiers=[
72+
"Environment :: Console",
73+
"Natural Language :: English",
74+
# How mature is this project? Common values are
75+
# 3 - Alpha, 4 - Beta, 5 - Production/Stable
76+
"Development Status :: 3 - Alpha",
77+
# Indicate who your project is intended for
78+
"Intended Audience :: Developers",
79+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
80+
# Pick your license as you wish
81+
"License :: OSI Approved :: Apache Software License",
82+
"Operating System :: OS Independent",
83+
# Specify the Python versions you support here. In particular, ensure
84+
# that you indicate whether you support Python 2, Python 3 or both.
85+
"Programming Language :: Python :: 3.8",
86+
],
87+
)

stochman/__init__.py

+23-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,26 @@
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
13-
# limitations under the License.
13+
# limitations under the License.
14+
"""Root package info."""
15+
16+
import logging as python_logging
17+
import os
18+
import time
19+
20+
_this_year = time.strftime("%Y")
21+
__version__ = "0.1"
22+
__author__ = "Nicki Skafte Detlefsen et al."
23+
__author_email__ = "nsde@dtu.dk"
24+
__license__ = "Apache-2.0"
25+
__copyright__ = f"Copyright (c) 2018-{_this_year}, {__author__}."
26+
__homepage__ = "https://github.com/CenterBioML/stochman"
27+
28+
__docs__ = "StochMan is a collection of elementary algorithms for computations on random manifolds"
29+
30+
_logger = python_logging.getLogger("stochman")
31+
_logger.addHandler(python_logging.StreamHandler())
32+
_logger.setLevel(python_logging.INFO)
33+
34+
PACKAGE_ROOT = os.path.dirname(__file__)
35+
PROJECT_ROOT = os.path.dirname(PACKAGE_ROOT)

tests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
13-
# limitations under the License.
13+
# limitations under the License.

0 commit comments

Comments
 (0)