-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix local build and install, originally by jiyongj (#779)
- Loading branch information
Arthur Muradyan
committed
Feb 3, 2022
1 parent
81f32a5
commit cb04e02
Showing
7 changed files
with
107 additions
and
53 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 |
---|---|---|
|
@@ -61,7 +61,7 @@ coverage.xml | |
.venv | ||
venv/ | ||
ENV/ | ||
virtualenv/ | ||
virtualenv*/ | ||
|
||
# mkdocs documentation | ||
/site | ||
|
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
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,25 +1,30 @@ | ||
import os | ||
|
||
src_folders = ["stix_shifter_utils", "stix_shifter", "stix_shifter_modules"] | ||
install_requires = set() | ||
requirements_files = [] | ||
for src_folder in src_folders: | ||
for r, d, f in os.walk(src_folder): | ||
for file in f: | ||
if 'requirements.txt'==file and not os.path.isfile(os.path.join(r, 'SKIP.ME')): | ||
requirements_files.append(os.path.join(r, file)) | ||
print('requirements_files: %s' % requirements_files) | ||
for requirements_file in requirements_files: | ||
with open(requirements_file) as f: | ||
lines = f.readlines() | ||
lines = [x.strip() for x in lines] | ||
lines = list(filter(lambda s: len(s)>0, lines)) | ||
install_requires.update(lines) | ||
install_requires = list(install_requires) | ||
install_requires.sort() | ||
print('install_requires: %s' % install_requires) | ||
def generate_requirements(): | ||
src_folders = ["stix_shifter_utils", "stix_shifter", "stix_shifter_modules"] | ||
install_requires = set() | ||
requirements_files = [] | ||
for src_folder in src_folders: | ||
for r, d, f in os.walk(src_folder): | ||
for file in f: | ||
if 'requirements.txt'==file and not os.path.isfile(os.path.join(r, 'SKIP.ME')): | ||
requirements_files.append(os.path.join(r, file)) | ||
print('requirements_files: %s' % requirements_files) | ||
for requirements_file in requirements_files: | ||
with open(requirements_file) as f: | ||
lines = f.readlines() | ||
lines = [x.strip() for x in lines] | ||
lines = list(filter(lambda s: len(s)>0, lines)) | ||
install_requires.update(lines) | ||
install_requires = list(install_requires) | ||
install_requires.sort() | ||
print('install_requires: %s' % install_requires) | ||
|
||
with open('requirements.txt', 'w') as out_file: | ||
for item in install_requires: | ||
out_file.write(item) | ||
out_file.write('\n') | ||
with open('requirements.txt', 'w') as out_file: | ||
for item in install_requires: | ||
out_file.write(item) | ||
out_file.write('\n') | ||
|
||
|
||
if __name__ == "__main__": | ||
generate_requirements() |
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
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
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
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