kosarev / z80

Fast and flexible Z80/i8080 emulator with C++ and Python APIs
MIT License
63 stars 10 forks source link

Support installing on Windows #36

Closed kosarev closed 2 years ago

kosarev commented 3 years ago

Initially requested in https://github.com/kosarev/z80/issues/33#issuecomment-907829756.

kosarev commented 3 years ago

@kidmirage Fixed building with python setup.py install and pip install z80. Please give it another try on your setup.

simonowen commented 3 years ago

It's working fine for me under Windows 10 (2004) with Python 3.9. Here's the command and output for each step:

C:\>pip install z80
Collecting z80
  Using cached z80-1.0b2.tar.gz (49 kB)
Building wheels for collected packages: z80
  Building wheel for z80 (setup.py) ... done
  Created wheel for z80: filename=z80-1.0b2-cp39-cp39-win_amd64.whl size=71097 sha256=24ffc0473646fb53952bff227aef8c75ba1c68f80aaf6bc0170e0481edb6f4d4
  Stored in directory: c:\users\simon\appdata\local\pip\cache\wheels\68\6c\d9\81a2e9d4bb022d176fe4649d75996df9243bf4c3cda6a56433
Successfully built z80
Installing collected packages: z80
Successfully installed z80-1.0b2
C:\>pip uninstall z80
Found existing installation: z80 1.0b2
Uninstalling z80-1.0b2:
  Would remove:
    c:\python39\lib\site-packages\z80-1.0b2.dist-info\*
    c:\python39\lib\site-packages\z80\*
    c:\python39\scripts\z80.exe
Proceed (Y/n)? y
  Successfully uninstalled z80-1.0b2
C:\z80>python setup.py install
running install
running bdist_egg
running egg_info
writing z80.egg-info\PKG-INFO
writing dependency_links to z80.egg-info\dependency_links.txt
writing entry points to z80.egg-info\entry_points.txt
writing top-level names to z80.egg-info\top_level.txt
adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
reading manifest file 'z80.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'z80.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_disasm.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_disasm_parser.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_error.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_instr.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_machine.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_main.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_source.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_token.py -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\_z80.cp39-win_amd64.pyd -> build\bdist.win-amd64\egg\z80
copying build\lib.win-amd64-3.9\z80\__init__.py -> build\bdist.win-amd64\egg\z80
byte-compiling build\bdist.win-amd64\egg\z80\_disasm.py to _disasm.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_disasm_parser.py to _disasm_parser.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_error.py to _error.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_instr.py to _instr.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_machine.py to _machine.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_main.py to _main.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_source.py to _source.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\_token.py to _token.cpython-39.pyc
byte-compiling build\bdist.win-amd64\egg\z80\__init__.py to __init__.cpython-39.pyc
creating stub loader for z80\_z80.cp39-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\z80\_z80.py to _z80.cpython-39.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying z80.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying z80.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying z80.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying z80.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying z80.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
z80.__pycache__._z80.cpython-39: module references __file__
creating 'dist\z80-1.0b2-py3.9-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing z80-1.0b2-py3.9-win-amd64.egg
creating c:\python39\lib\site-packages\z80-1.0b2-py3.9-win-amd64.egg
Extracting z80-1.0b2-py3.9-win-amd64.egg to c:\python39\lib\site-packages
Adding z80 1.0b2 to easy-install.pth file
Installing z80-script.py script to C:\Python39\Scripts
Installing z80.exe script to C:\Python39\Scripts

Installed c:\python39\lib\site-packages\z80-1.0b2-py3.9-win-amd64.egg
Processing dependencies for z80==1.0b2
Finished processing dependencies for z80==1.0b2
[C:\]python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import z80
>>> dir(z80)
['Error', 'I8080Machine', 'Z80Machine', '_Disasm', '_DisasmTagParser', '_SourceFile', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_disasm', '_disasm_parser', '_error', '_instr', '_machine', '_main', '_source', '_token', '_z80', 'main']
kosarev commented 2 years ago

Closing this as resolved. Please feel free to re-open, if anything.