Skip to content

Commit

Permalink
setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki committed Jan 18, 2021
1 parent 1898a9d commit f93915e
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 2 deletions.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
torch>=1.6
numpy>=1.16.4
18 changes: 18 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[flake8]
# TODO: this should be 88 or 100 according PEP8
max-line-length = 120
exclude = .tox,*.egg,build,temp
select = E,W,F
doctests = True
verbose = 2
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
format = pylint
ignore = E731,W504,F401,F841,E722,W503

[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1

[upload_sphinx]
upload-dir = doc/build/html
87 changes: 87 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright The GeoML Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from io import open

from setuptools import setup, find_packages, Command

try:
import builtins
except ImportError:
import __builtin__ as builtins

PATH_ROOT = os.path.dirname(__file__)
builtins.__STOCHMAN_SETUP__ = True

import stochman


class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""

user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info")


PATH_ROOT = os.path.dirname(__file__)


def load_requirements(path_dir=PATH_ROOT, comment_char="#"):
with open(os.path.join(path_dir, "requirements.txt"), "r") as file:
lines = [ln.strip() for ln in file.readlines()]
reqs = []
for ln in lines:
# filer all comments
if comment_char in ln:
ln = ln[: ln.index(comment_char)]
if ln: # if requirement is not empty
reqs.append(ln)
return reqs


setup(
name="stochman",
version=stochman.__version__,
description=stochman.__docs__,
author=stochman.__author__,
author_email=stochman.__author_email__,
license=stochman.__license__,
packages=find_packages(),
python_requires=">=3.8",
install_requires=load_requirements(PATH_ROOT),
classifiers=[
"Environment :: Console",
"Natural Language :: English",
# How mature is this project? Common values are
# 3 - Alpha, 4 - Beta, 5 - Production/Stable
"Development Status :: 3 - Alpha",
# Indicate who your project is intended for
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
# Pick your license as you wish
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 3.8",
],
)
24 changes: 23 additions & 1 deletion stochman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,26 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
"""Root package info."""

import logging as python_logging
import os
import time

_this_year = time.strftime("%Y")
__version__ = "0.1"
__author__ = "Nicki Skafte Detlefsen et al."
__author_email__ = "nsde@dtu.dk"
__license__ = "Apache-2.0"
__copyright__ = f"Copyright (c) 2018-{_this_year}, {__author__}."
__homepage__ = "https://github.com/CenterBioML/stochman"

__docs__ = "StochMan is a collection of elementary algorithms for computations on random manifolds"

_logger = python_logging.getLogger("stochman")
_logger.addHandler(python_logging.StreamHandler())
_logger.setLevel(python_logging.INFO)

PACKAGE_ROOT = os.path.dirname(__file__)
PROJECT_ROOT = os.path.dirname(PACKAGE_ROOT)
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.

0 comments on commit f93915e

Please sign in to comment.