11#!/usr/bin/python3
22# coding: utf-8
33import os
4+ import pathlib
45import sys
56
67from setuptools import setup
78from setuptools .command .install import install
89
910VERSION = "5.0.0"
1011
11- with open ("README.md" , "r" ) as fh :
12- long_description = fh .read ()
12+ HERE = pathlib .Path (__file__ ).parent
13+ README = (HERE / "README.md" ).read_text ()
14+
15+ # Get requirements from files
16+ requirements = (HERE / "requirements.txt" ).read_text ().split ("\n " )
17+ requirements_test = (HERE / "test-requirements.txt" ).read_text ().split ("\n " )
1318
1419
1520class VerifyVersionCommand (install ):
@@ -29,7 +34,7 @@ def run(self):
2934 version = VERSION ,
3035 python_requires = ">=3.7" ,
3136 description = "Python API client for OpenCTI." ,
32- long_description = long_description ,
37+ long_description = README ,
3338 long_description_content_type = "text/markdown" ,
3439 author = "OpenCTI" ,
3540@@ -51,21 +56,10 @@ def run(self):
5156 "Topic :: Software Development :: Libraries :: Python Modules" ,
5257 ],
5358 include_package_data = True ,
54- install_requires = [
55- "requests==2.25.1" ,
56- "PyYAML==5.4.1" ,
57- "python-dateutil==2.8.1" ,
58- "datefinder==0.7.1" ,
59- "stix2==2.1.0" ,
60- "pytz==2021.1" ,
61- "pika==1.2.0" ,
62- "sseclient==0.0.27" ,
63- "python-magic==0.4.22;sys.platform=='linux' or sys.platform=='darwin'" ,
64- "python-magic-bin==0.4.14;sys.platform=='win32'" ,
65- ],
59+ install_requires = requirements ,
6660 cmdclass = {"verify" : VerifyVersionCommand },
6761 extras_require = {
68- "dev" : [ "black" , "wheel" , "pytest" , "pytest-cov" , "pre-commit" ] ,
62+ "dev" : requirements_test + requirements ,
6963 "doc" : ["autoapi" , "sphinx_rtd_theme" , "sphinx-autodoc-typehints" ],
7064 }, # Optional
7165)
0 commit comments