Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabioz/py_compile_win_helpers
Helpers to setup the environment to compile extensions for Python.
https://github.com/fabioz/py_compile_win_helpers
Last synced: 27 days ago
JSON representation
Helpers to setup the environment to compile extensions for Python.
- Host: GitHub
- URL: https://github.com/fabioz/py_compile_win_helpers
- Owner: fabioz
- License: mit
- Created: 2017-05-09T18:19:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T10:24:36.000Z (3 months ago)
- Last Synced: 2024-10-06T12:50:43.205Z (about 1 month ago)
- Language: Python
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py_compile_win_helpers
Helpers to setup the environment to compile extensions for Python.
It's meant to be used in Python code to automate getting a library and building
it as an extension module without relying on the current env.It should take care of env variables such as MSSdk, DISTUTILS_USE_SDK, finding
the compiler and executing vcvarsall or SetEnv as needed.Example:
def main():
subprocess.check_call(['git', 'clone', 'some_repo'])
import py_compile_win_helpers
env = py_compile_win_helpers.get_compile_env()
subprocess.check_call(['python', 'setup.py', 'clean'], env=env, cwd=os.path.join('some_repo'))
subprocess.check_call(['python', 'setup.py', 'build'], env=env, cwd=os.path.join('some_repo'))It's also possible to get it for another python executable:
def main():
subprocess.check_call(['git', 'clone', 'some_repo'])
import py_compile_win_helpers
env = py_compile_win_helpers.get_compile_env(py_32_64)
subprocess.check_call([py_32_64, 'setup.py', 'clean'], env=env, cwd=os.path.join('some_repo'))
subprocess.check_call([py_32_64, 'setup.py', 'bdist_egg'], env=env, cwd=os.path.join('some_repo'))Can be installed with:
pip install py_compile_win_helpers
# Requisites
For Python 2.6 and 2.7, Microsoft Visual C++ Compiler for Python 2.7 is needed.
-- https://www.microsoft.com/en-us/download/details.aspx?id=44266For Python 3.3 and 3.4, Visual Studio 2010 Express is needed.
For Python 3.5 and 3.6, Visual Studio 2015 is needed.
-- Note, older versions can be found at https://www.visualstudio.com/vs/older-downloads/
but you need to register with Microsoft (free) to be able to find downloads for older versions of Visual Studiohttps://wiki.python.org/moin/WindowsCompilers can be of help too.