-
Notifications
You must be signed in to change notification settings - Fork 15
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
Michele Fabbri
committed
May 24, 2022
1 parent
2277700
commit 4e71950
Showing
2 changed files
with
52 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.1" |
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 |
---|---|---|
@@ -1,12 +1,56 @@ | ||
from setuptools import setup, find_packages | ||
import sys | ||
from pathlib import Path | ||
|
||
from setuptools import find_packages, setup | ||
|
||
CURRENT_DIRECTORY = Path(__file__).parent.absolute() | ||
CURRENT_PYTHON = sys.version_info[:2] | ||
REQUIRED_PYTHON = (3, 8) | ||
VER_ERR_MSG = """ | ||
========================== | ||
Unsupported Python version | ||
========================== | ||
This version of ibllib requires Python {}.{}, but you're trying to install it on Python {}.{}. | ||
""" | ||
if CURRENT_PYTHON < REQUIRED_PYTHON: | ||
sys.stderr.write(VER_ERR_MSG.format(*REQUIRED_PYTHON + CURRENT_PYTHON)) | ||
sys.exit(1) | ||
|
||
with open("README.md", "r") as f: | ||
long_description = f.read() | ||
|
||
with open("requirements.txt") as f: | ||
require = [x.strip() for x in f.readlines() if not x.startswith("git+")] | ||
|
||
|
||
def read(rel_path): | ||
here = Path(__file__).parent.absolute() | ||
with open(here.joinpath(rel_path), "r") as fp: | ||
return fp.read() | ||
|
||
|
||
def get_version(rel_path): | ||
for line in read(rel_path).splitlines(): | ||
if line.startswith("__version__"): | ||
delim = '"' if '"' in line else "'" | ||
return line.split(delim)[1] | ||
else: | ||
raise RuntimeError("Unable to find version string.") | ||
|
||
with open('requirements.txt') as f: | ||
require = [x.strip() for x in f.readlines() if not x.startswith('git+')] | ||
|
||
setup( | ||
name='iblapps', | ||
version='0.1', | ||
packages=find_packages(), | ||
name="iblapps", | ||
version=get_version("__init__.py"), | ||
python_requires=">={}.{}".format(*REQUIRED_PYTHON), | ||
description="IBL Applications", | ||
license="MIT", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author="IBL Staff", | ||
url="https://www.internationalbrainlab.com/", | ||
packages=find_packages(exclude=["scratch"]), # same as name | ||
include_package_data=True, | ||
install_requires=require | ||
# external packages as dependencies | ||
install_requires=require, | ||
scripts=[], | ||
) |