FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
scons/setup.py at master · softagram/scons · GitHub
softagram
/
scons
Public
forked from
SCons/scons
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
scons
/
setup.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (34 loc) · 1.18 KB
Breadcrumbs
scons
/
setup.py
Copy path
File metadata and controls
46 lines (34 loc) · 1.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!python3
import
fnmatch
from
setuptools
import
setup
from
setuptools
.
command
.
build_py
import
build_py
as
build_py_orig
import
codecs
import
os
.
path
def
read
(
rel_path
):
here
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
with
codecs
.
open
(
os
.
path
.
join
(
here
,
rel_path
),
'r'
)
as
fp
:
return
fp
.
read
()
def
get_version
(
rel_path
):
for
line
in
read
(
rel_path
).
splitlines
():
if
line
.
startswith
(
'__version__'
):
delim
=
'"'
if
'"'
in
line
else
"'"
return
line
.
split
(
delim
)[
1
]
else
:
raise
RuntimeError
(
"Unable to find version string."
)
exclude
=
[
'*Tests'
]
class
build_py
(
build_py_orig
):
def
find_package_modules
(
self
,
package
,
package_dir
):
"""
Custom module to find package modules.
It will strip out any modules which match the glob patters in exclude above
"""
modules
=
super
().
find_package_modules
(
package
,
package_dir
)
return
[(
pkg
,
mod
,
file
, )
for
(
pkg
,
mod
,
file
, )
in
modules
if
not
any
(
fnmatch
.
fnmatchcase
(
mod
,
pat
=
pattern
)
for
pattern
in
exclude
)]
setup
(
cmdclass
=
{
'build_py'
:
build_py
,
},
version
=
get_version
(
'SCons/__init__.py'
),
)
Back
|
FazBrowse Home
|
New Git URL