forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate from requirements.txt/setup.py to setup.cfg (localstack#5606)
- Loading branch information
1 parent
3efb640
commit 44ae7ee
Showing
9 changed files
with
114 additions
and
156 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
include requirements.txt | ||
include Makefile | ||
include LICENSE.txt | ||
recursive-include localstack/ext *.java | ||
|
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 was deleted.
Oops, something went wrong.
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,63 +1,4 @@ | ||
#!/usr/bin/env python | ||
import re | ||
from collections import defaultdict | ||
from setuptools import setup | ||
|
||
from plugin.setuptools import load_entry_points | ||
from setuptools import find_packages, setup | ||
|
||
|
||
def parse_requirements(lines): | ||
requirements = defaultdict(list) | ||
extra = "install" | ||
|
||
for line in lines: | ||
line = line.strip() | ||
if line.startswith("# extra="): | ||
# all subsequent lines are associated with this extra, until a new extra appears | ||
extra = line.split("=")[1] | ||
continue | ||
|
||
if line and line[0] == "#" and "#egg=" in line: | ||
line = re.search(r"#\s*(.*)", line).group(1) | ||
|
||
if line and line[0] != "#": | ||
lib_stripped = line.split(" #")[0].strip() | ||
requirements[extra].append(lib_stripped) | ||
|
||
return requirements | ||
|
||
|
||
# define package data | ||
package_data = { | ||
"": ["Makefile", "*.md"], | ||
"localstack": [ | ||
"package.json", | ||
"requirements*.txt", | ||
"utils/kinesis/java/cloud/localstack/*.*", | ||
], | ||
} | ||
|
||
# determine requirements | ||
with open("requirements.txt") as f: | ||
req = parse_requirements(f.readlines()) | ||
|
||
install_requires = req["install"] | ||
|
||
extras_require = { | ||
"cli": req["install"], | ||
"runtime": req["runtime"], | ||
"test": req["test"], | ||
"dev": req["dev"], | ||
} | ||
extras_require["full"] = extras_require["cli"] + extras_require["runtime"] # deprecated | ||
|
||
if __name__ == "__main__": | ||
setup( | ||
scripts=["bin/localstack", "bin/localstack.bat"], | ||
packages=find_packages(exclude=("tests", "tests.*")), | ||
package_data=package_data, | ||
install_requires=install_requires, | ||
extras_require=extras_require, | ||
entry_points=load_entry_points(exclude=("tests", "tests.*")), | ||
test_suite="tests", | ||
) | ||
setup() |