-
-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ckport vagrant workaround from #1677 and re-use dist_utils.py instead of
duplicating the code across setup.py files. Note: This file is copied over from the common location to each component directory during the build step.
- Loading branch information
Showing
23 changed files
with
442 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# Licensed to the StackStorm, Inc ('StackStorm') under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from pip.req import parse_requirements | ||
|
||
__all__ = [ | ||
'fetch_requirements', | ||
'apply_vagrant_workaround' | ||
] | ||
|
||
|
||
def fetch_requirements(requirements_file_path): | ||
""" | ||
Return a list of requirements and links by parsing the provided requirements file. | ||
""" | ||
links = [] | ||
reqs = [] | ||
for req in parse_requirements(requirements_file_path, session=False): | ||
if req.link: | ||
links.append(str(req.link)) | ||
reqs.append(str(req.req)) | ||
return (reqs, links) | ||
|
||
|
||
def apply_vagrant_workaround(): | ||
""" | ||
Function which detects if the script is being executed inside vagrant and if it is, it deletes | ||
"os.link" attribute. | ||
Note: Without this workaround, setup.py sdist will fail when running inside a shared directory | ||
(nfs / virtualbox shared folders). | ||
""" | ||
if os.environ.get('USER', None) == 'vagrant': | ||
del os.link |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# Licensed to the StackStorm, Inc ('StackStorm') under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from pip.req import parse_requirements | ||
|
||
__all__ = [ | ||
'fetch_requirements', | ||
'apply_vagrant_workaround' | ||
] | ||
|
||
|
||
def fetch_requirements(requirements_file_path): | ||
""" | ||
Return a list of requirements and links by parsing the provided requirements file. | ||
""" | ||
links = [] | ||
reqs = [] | ||
for req in parse_requirements(requirements_file_path, session=False): | ||
if req.link: | ||
links.append(str(req.link)) | ||
reqs.append(str(req.req)) | ||
return (reqs, links) | ||
|
||
|
||
def apply_vagrant_workaround(): | ||
""" | ||
Function which detects if the script is being executed inside vagrant and if it is, it deletes | ||
"os.link" attribute. | ||
Note: Without this workaround, setup.py sdist will fail when running inside a shared directory | ||
(nfs / virtualbox shared folders). | ||
""" | ||
if os.environ.get('USER', None) == 'vagrant': | ||
del os.link |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# Licensed to the StackStorm, Inc ('StackStorm') under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from pip.req import parse_requirements | ||
|
||
__all__ = [ | ||
'fetch_requirements', | ||
'apply_vagrant_workaround' | ||
] | ||
|
||
|
||
def fetch_requirements(requirements_file_path): | ||
""" | ||
Return a list of requirements and links by parsing the provided requirements file. | ||
""" | ||
links = [] | ||
reqs = [] | ||
for req in parse_requirements(requirements_file_path, session=False): | ||
if req.link: | ||
links.append(str(req.link)) | ||
reqs.append(str(req.req)) | ||
return (reqs, links) | ||
|
||
|
||
def apply_vagrant_workaround(): | ||
""" | ||
Function which detects if the script is being executed inside vagrant and if it is, it deletes | ||
"os.link" attribute. | ||
Note: Without this workaround, setup.py sdist will fail when running inside a shared directory | ||
(nfs / virtualbox shared folders). | ||
""" | ||
if os.environ.get('USER', None) == 'vagrant': | ||
del os.link |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# Licensed to the StackStorm, Inc ('StackStorm') under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from pip.req import parse_requirements | ||
|
||
__all__ = [ | ||
'fetch_requirements', | ||
'apply_vagrant_workaround' | ||
] | ||
|
||
|
||
def fetch_requirements(requirements_file_path): | ||
""" | ||
Return a list of requirements and links by parsing the provided requirements file. | ||
""" | ||
links = [] | ||
reqs = [] | ||
for req in parse_requirements(requirements_file_path, session=False): | ||
if req.link: | ||
links.append(str(req.link)) | ||
reqs.append(str(req.req)) | ||
return (reqs, links) | ||
|
||
|
||
def apply_vagrant_workaround(): | ||
""" | ||
Function which detects if the script is being executed inside vagrant and if it is, it deletes | ||
"os.link" attribute. | ||
Note: Without this workaround, setup.py sdist will fail when running inside a shared directory | ||
(nfs / virtualbox shared folders). | ||
""" | ||
if os.environ.get('USER', None) == 'vagrant': | ||
del os.link |
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
Oops, something went wrong.