-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We were wrapping easy_install's 'install_scripts' and 'develop' methods to generate a custom WSGI script. This was a replacement of functionality previously provided by PBR. Unfortunately easy_install is deprecated for removal at a future date and we don't yet have a modern equivalent in pip [1]. As such, we need a migration plan for this and it seems like the old school 'scripts' option is probably it. The main downside of this is that the shebang isn't updated accordingly, which means this won't work very well in virtualenvs, but I'm hoping that the use of '/usr/bin/env' will allow us to work around this. At least in local testing, it seems like this is the case: ❯ virtualenv .venv ❯ pip install . ❯ cat .venv/bin/gnocchi-api | head -1 #!/gnocchi/.venv/bin/python [1] https://discuss.python.org/t/adding-support-for-wsgi-scripts-entrypoint/30905 Signed-off-by: Stephen Finucane <[email protected]>
- Loading branch information
1 parent
51c35cd
commit 3f45e24
Showing
3 changed files
with
25 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Licensed 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 sys | ||
from gnocchi.cli import api | ||
|
||
if __name__ == '__main__': | ||
sys.exit(api.api()) | ||
else: | ||
application = api.wsgi() |
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