|
1 | 1 | #!/usr/bin/env python
|
2 | 2 | # -*- coding: utf-8 -*-
|
3 |
| -import os |
| 3 | +import pathlib |
4 | 4 |
|
| 5 | +from pkg_resources import parse_requirements |
5 | 6 | from setuptools import setup, find_packages
|
6 | 7 |
|
| 8 | +# Repository root directory for use with reading files |
| 9 | +directory = pathlib.Path(__path__).parent |
7 | 10 |
|
8 |
| -# Utility function to read the README file. |
9 |
| -# Used for the long_description. It's nice, because now 1) we have a top level |
10 |
| -# README file and 2) it's easier to type in the README file than to put a raw |
11 |
| -# string in below ... |
12 |
| -def read(fname): |
13 |
| - return open(os.path.join(os.path.dirname(__file__), fname)).read() |
14 |
| - |
15 |
| - |
16 |
| -install_requires_replacements = {} |
17 |
| - |
18 |
| -install_requirements = list(set( |
19 |
| - install_requires_replacements.get(requirement.strip(), requirement.strip()) |
20 |
| - for requirement in open('requirements.txt') |
21 |
| - if not requirement.lstrip().startswith('#') |
22 |
| -)) |
| 11 | +# Load install_requires from requirements.txt. |
| 12 | +# https://stackoverflow.com/a/59971236/4651668 |
| 13 | +requirements = directory.joinpath('requirements.txt').read_text() |
| 14 | +requirements = [str(r) for r in parse_requirements(requirements)] |
23 | 15 |
|
24 | 16 | version = '1.8.1' # Do not edit: this is maintained by bumpversion (see .bumpversion.cfg)
|
25 | 17 |
|
26 | 18 | setup(
|
27 | 19 | name='rotkehlchen',
|
28 | 20 | author='Lefteris Karapetsas',
|
29 | 21 |
|
30 |
| - description=('Acccounting, asset management and tax report helper for cryptocurrencies'), |
| 22 | + description='Acccounting, asset management and tax report helper for cryptocurrencies', |
31 | 23 | license='BSD-3',
|
32 | 24 | keywords='accounting tax-report portfolio asset-management cryptocurrencies',
|
33 | 25 | url='https://github.com/rotki/rotki',
|
34 | 26 | packages=find_packages('.'),
|
35 | 27 | package_data={
|
36 | 28 | "rotkehlchen": ["data/*.json"],
|
37 | 29 | },
|
38 |
| - install_requires=install_requirements, |
| 30 | + python_requires='>=3.6', |
| 31 | + install_requires=requirements, |
39 | 32 | use_scm_version=True,
|
40 | 33 | setup_requires=['setuptools_scm'],
|
41 |
| - long_description=read('README.md'), |
| 34 | + long_description=directory.joinpath('README.md').read_text(), |
| 35 | + long_description_content_type='text/markdown', |
42 | 36 | classifiers=[
|
43 | 37 | 'Development Status :: 1 - Planning',
|
44 | 38 | 'Topic :: Utilities',
|
|
0 commit comments