File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1+ include README.md
2+ include LICENSE
3+ include requirements.txt
4+ recursive-include knockpy/wordlist *.txt
5+
Original file line number Diff line number Diff line change 11from setuptools import find_packages , setup
22import os
33
4- def load_requirements (path ):
5- with open (path , "r" ) as f :
6- return [line .strip () for line in f if line .strip () and not line .startswith ("#" )]
4+ HERE = os .path .abspath (os .path .dirname (__file__ ))
5+
6+
7+ def load_requirements (path : str ) -> list [str ]:
8+ """Load requirements from a local file.
9+
10+ Must work under PEP 517 isolated builds (wheel-from-sdist), so resolve the
11+ path relative to this file and fail gracefully if the file isn't present.
12+ """
13+ req_path = os .path .join (HERE , path )
14+ try :
15+ with open (req_path , "r" , encoding = "utf-8" ) as f :
16+ return [line .strip () for line in f if line .strip () and not line .startswith ("#" )]
17+ except FileNotFoundError :
18+ return []
719
820wordlist = 'wordlist' + os .sep + 'wordlist.txt'
921
You can’t perform that action at this time.
0 commit comments