Skip to content

Commit

Permalink
Add __main__ module to Python's egg (#1418)
Browse files Browse the repository at this point in the history
* Revert "Remove __main__ module" (commit a85e6cd).

* Add __main__ to Python's egg
  • Loading branch information
narrieta authored Dec 14, 2018
1 parent 5dad5d8 commit 6161387
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions __main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2018 Microsoft Corporation
#
# 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.
#
# Requires Python 2.6+ and Openssl 1.0+
#

import azurelinuxagent.agent as agent

agent.main()
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ def run(self):
if float(sys.version[:3]) >= 3.7:
requires = ['distro']

modules = []

if "bdist_egg" in sys.argv:
modules.append("__main__")

setuptools.setup(
name=AGENT_NAME,
version=AGENT_VERSION,
Expand All @@ -231,6 +236,7 @@ def run(self):
url='https://github.com/Azure/WALinuxAgent',
license='Apache License Version 2.0',
packages=find_packages(exclude=["tests*"]),
py_modules=modules,
install_requires=requires,
cmdclass={
'install': install
Expand Down

0 comments on commit 6161387

Please sign in to comment.