Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
fa390e1e
Unverified
Commit
fa390e1e
authored
Oct 15, 2021
by
moto
Committed by
GitHub
Oct 15, 2021
Browse files
Update prototype exclusion (#1885)
parent
d5e44f87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
setup.py
setup.py
+20
-7
No files found.
setup.py
View file @
fa390e1e
#!/usr/bin/env python
#!/usr/bin/env python
import
os
import
os
import
re
import
shutil
import
shutil
import
subprocess
import
subprocess
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -11,14 +12,16 @@ from build_tools import setup_helpers
...
@@ -11,14 +12,16 @@ from build_tools import setup_helpers
ROOT_DIR
=
Path
(
__file__
).
parent
.
resolve
()
ROOT_DIR
=
Path
(
__file__
).
parent
.
resolve
()
def
_run_cmd
(
cmd
,
default
):
try
:
return
subprocess
.
check_output
(
cmd
,
cwd
=
ROOT_DIR
).
decode
(
'ascii'
).
strip
()
except
Exception
:
return
default
# Creating the version file
# Creating the version file
version
=
'0.10.0a0'
version
=
'0.10.0a0'
sha
=
'Unknown'
sha
=
_run_cmd
([
'git'
,
'rev-parse'
,
'HEAD'
],
default
=
'Unknown'
)
try
:
sha
=
subprocess
.
check_output
([
'git'
,
'rev-parse'
,
'HEAD'
],
cwd
=
ROOT_DIR
).
decode
(
'ascii'
).
strip
()
except
Exception
:
pass
if
os
.
getenv
(
'BUILD_VERSION'
):
if
os
.
getenv
(
'BUILD_VERSION'
):
version
=
os
.
getenv
(
'BUILD_VERSION'
)
version
=
os
.
getenv
(
'BUILD_VERSION'
)
...
@@ -65,7 +68,17 @@ def _get_packages():
...
@@ -65,7 +68,17 @@ def _get_packages():
"third_party*"
,
"third_party*"
,
"build_tools*"
,
"build_tools*"
,
]
]
if
os
.
environ
.
get
(
'UPLOAD_CHANNEL'
,
''
)
==
'test'
:
exclude_prototype
=
False
branch_name
=
_run_cmd
([
'git'
,
'rev-parse'
,
'--abbrev-ref'
,
'HEAD'
],
default
=
None
)
is_on_tag
=
_run_cmd
([
'git'
,
'describe'
,
'--tags'
,
'--exact-match'
,
'@'
],
default
=
None
)
if
branch_name
is
not
None
and
branch_name
.
startswith
(
'release/'
):
print
(
'On release branch'
)
exclude_prototype
=
True
if
is_on_tag
is
not
None
and
re
.
match
(
r
'v[\d.]+(-rc\d+)?'
,
is_on_tag
):
print
(
'On release tag'
)
exclude_prototype
=
True
if
exclude_prototype
:
print
(
'Excluding torchaudio.prototype from the package.'
)
print
(
'Excluding torchaudio.prototype from the package.'
)
exclude
.
append
(
"torchaudio.prototype"
)
exclude
.
append
(
"torchaudio.prototype"
)
return
find_packages
(
exclude
=
exclude
)
return
find_packages
(
exclude
=
exclude
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment