Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit aa2f017

Browse files
authored
solves #200 and installation adjustments (#201)
* soften the requirements + splitting test/prod requirements + removing duplicates and adjusted setup.py * moved pytest-cases to test requirements
1 parent 60020ba commit aa2f017

File tree

3 files changed

+26
-30
lines changed

3 files changed

+26
-30
lines changed

requirements.txt

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
requests==2.25.1
2-
PyYAML==5.4.1
3-
setuptools==56.0.0
4-
python-dateutil==2.8.1
5-
datefinder==0.7.1
6-
stix2==2.1.0
7-
pytz==2021.1
8-
pika==1.2.0
9-
sseclient==0.0.27
10-
black==20.8b1
11-
python-magic==0.4.22; sys_platform == 'linux' or sys_platform == 'darwin'
12-
python-magic-bin==0.4.14; sys_platform == 'win32'
13-
pytest_randomly==3.8.0
14-
pytest-cases==3.6.3
1+
requests~=2.26
2+
PyYAML~=5.4
3+
setuptools~=56.0
4+
datefinder~=0.7
5+
stix2~=2.1
6+
pika~=1.2
7+
sseclient~=0.0.27
8+
python-magic~=0.4; sys_platform == 'linux' or sys_platform == 'darwin'
9+
python-magic-bin~=0.4; sys_platform == 'win32'

setup.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
#!/usr/bin/python3
22
# coding: utf-8
33
import os
4+
import pathlib
45
import sys
56

67
from setuptools import setup
78
from setuptools.command.install import install
89

910
VERSION = "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

1520
class 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
author_email="[email protected]",
@@ -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
)

test-requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pytest_randomly~=3.8
2+
black==20.8b1
3+
pre-commit~=2.13
4+
wheel~=0.36
5+
pytest~=6.2
6+
pytest-cov~=2.12
7+
pytest-cases~=3.6

0 commit comments

Comments
 (0)