Python 3 compatibility, sort of, maybe #103

Merged
eevee merged 12 commits from py3 into master 2017-02-13 23:09:31 +00:00
eevee commented 2016-08-25 00:55:21 +00:00 (Migrated from github.com)

The first commit is entirely automated, using futurize --stage1 (a subset of 2to3 that avoids doing anything that would break 2). Looks like it accidentally nuked the CRs from a couple files, which has made this diff look much worse than it actually is.

Successfully builds both pokered and pokeyellow using CPython 2.7 and CPython 3.5 and maybe even a PyPy in there somewhere. Makes me happy since bare python is Python 3 on Arch.

The test suite appears to be on fire, which makes it hard to tell if I broke anything. May keep poking at this, though.

The first commit is entirely automated, using `futurize --stage1` (a subset of `2to3` that avoids doing anything that would break 2). Looks like it accidentally nuked the CRs from a couple files, which has made this diff look much worse than it actually is. Successfully builds both pokered and pokeyellow using CPython 2.7 and CPython 3.5 and maybe even a PyPy in there somewhere. Makes me happy since bare `python` is Python 3 on Arch. The test suite appears to be on fire, which makes it hard to tell if I broke anything. May keep poking at this, though.
kanzure commented 2016-08-25 01:26:40 +00:00 (Migrated from github.com)

Well, one way to fix the test suites is to keep deleting code and tests until everything is "passing". I guess we should setup travis-ci, since we are trying to not live in the dark ages and such.

Well, one way to fix the test suites is to keep deleting code and tests until everything is "passing". I guess we should setup travis-ci, since we are trying to not live in the dark ages and such.
eevee commented 2016-08-25 01:27:31 +00:00 (Migrated from github.com)

Oho, believe me, I love deleting stuff that no one can justify keeping around. :D

Oho, believe me, I _love_ deleting stuff that no one can justify keeping around. :D
PikalaxALT commented 2017-02-18 01:11:53 +00:00 (Migrated from github.com)

Relative imports render poketools unusable as a git submodule.

Relative imports render poketools unusable as a git submodule.
eevee commented 2017-02-18 15:14:14 +00:00 (Migrated from github.com)

That sounds backwards; relative imports exist for cases like submodules.

That sounds backwards; relative imports exist _for_ cases like submodules.
Sanqui commented 2017-03-16 12:46:28 +00:00 (Migrated from github.com)

This is probably the issue @PikalaxALT ran into.

sanky@suguri:~/romhacking/gb/pokered$ make PYTHON=python2
rgbasm -D _RED -h -o audio_red.o audio.asm
Traceback (most recent call last):
  File "extras/pokemontools/gfx.py", line 7, in <module>
    from . import png
ValueError: Attempted relative import in non-package
Makefile:51: recipe for target 'gfx/AB.2bpp' failed
make: *** [gfx/AB.2bpp] Error 1
sanky@suguri:~/romhacking/gb/pokered$ make PYTHON=python3
Traceback (most recent call last):
  File "extras/pokemontools/gfx.py", line 7, in <module>
    from . import png
SystemError: Parent module '' not loaded, cannot perform relative import
Makefile:51: recipe for target 'gfx/AB.2bpp' failed
make: *** [gfx/AB.2bpp] Error 1
This is probably the issue @PikalaxALT ran into. ``` sanky@suguri:~/romhacking/gb/pokered$ make PYTHON=python2 rgbasm -D _RED -h -o audio_red.o audio.asm Traceback (most recent call last): File "extras/pokemontools/gfx.py", line 7, in <module> from . import png ValueError: Attempted relative import in non-package Makefile:51: recipe for target 'gfx/AB.2bpp' failed make: *** [gfx/AB.2bpp] Error 1 ``` ``` sanky@suguri:~/romhacking/gb/pokered$ make PYTHON=python3 Traceback (most recent call last): File "extras/pokemontools/gfx.py", line 7, in <module> from . import png SystemError: Parent module '' not loaded, cannot perform relative import Makefile:51: recipe for target 'gfx/AB.2bpp' failed make: *** [gfx/AB.2bpp] Error 1 ```
kemenaran commented 2017-10-27 12:48:02 +00:00 (Migrated from github.com)

@PikalaxALT For reference, and for other people reading this page, I worked around this "can't relative import" error by invoking the tools as python -m pokemontools.gbz80disasm (rather than for instance python pokemontools/gbz80disasm.py).

@PikalaxALT For reference, and for other people reading this page, I worked around this "can't relative import" error by invoking the tools as `python -m pokemontools.gbz80disasm` (rather than for instance `python pokemontools/gbz80disasm.py`).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
decomp/pokemon-reverse-engineering-tools!103
No description provided.