Hello #1

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
4 participants

Here is pudb which is python3 ready. Let me know if you want me to some changes.

@inducer inducer commented on the diff Jul 8, 2011

@@ -1,22 +1,39 @@
#!/usr/bin/env python
+"""
+TODO: Write bootstrap code covering setuptools and distutils.
@inducer

inducer Jul 8, 2011

Owner

not sure what you mean here

@inducer inducer commented on the diff Jul 8, 2011

-
- Its goal is to provide all the niceties of modern GUI-based debuggers in a
- more lightweight and keyboard-friendly package. PuDB allows you to debug code
- right where you write and test it--in a terminal. If you've worked with the
- excellent (but nowadays ancient) DOS-based Turbo Pascal or C tools, PuDB's UI
+"""
+
+try:
+ from setuptools import setup, Extension
+ have_setuptools = True
+except ImportError:
+ from distutils.core import setup, Extension
+ have_setuptools = False
+
+try:
+ PYTHON3 = not str is bytes
@inducer

inducer Jul 8, 2011

Owner

why not check sys.version for this?

@inducer inducer commented on the diff Jul 8, 2011

+
+try:
+ from setuptools import setup, Extension
+ have_setuptools = True
+except ImportError:
+ from distutils.core import setup, Extension
+ have_setuptools = False
+
+try:
+ PYTHON3 = not str is bytes
+except NameError:
+ PYTHON3 = False
+
+#from pudb import VERSION
+
+setup_d = {'name':'pudb',
@inducer

inducer Jul 8, 2011

Owner

I'm not sure I understand why it's necessary to build this dict ahead of time--the original syntax, with an additional **kwargs at the end is perfectly up to the job.

@orsenthil I'd like to work pudb in Python 3 - any objection to starting with what you've got, and trying to address the remaining concerns of @inducer?

Go ahead Thomas. No objects. In fact, I was slacker because I had my version working in python 3 for my needs, you can brush it and address inducer's comments. let me know if you need any (quick) help.

Contributor

bfroehle commented Jul 13, 2012

Another issue with this pull request is that it doesn't seem to handle setting VERSION in setup.py. Would you object to splitting the version information into a separate file (like pudb/_release.py)? Unfortunately it'd have to look something like:

### pudb/_release.py ###
NUM_VERSION = (2012, 2, 1)
VERSION = ".".join(str(nv) for nv in NUM_VERSION)

### pudb/__init__.py ###
from pudb._release import NUM_VERSION, VERSION
...

### setup.py ###
...
try:
    execfile
except:
    def execfile(fname, globs, locs=None):
        exec(compile(open(fname).read(), globs, locs or globs)

# Read version string from pudb/_release.py
execfile(os.path.join('pudb', '_release.py'), globals())
Contributor

bfroehle commented Jul 13, 2012

Alternatively it might be easy enough to just convert to a syntax which is both Python 2 and Python 3 compatible. What is the minimum version of Python that pudb is targeting?

Owner

inducer commented Jul 14, 2012

Either option would be fine.

Contributor

bfroehle commented Jul 14, 2012

I've done some preliminary work on a Python 2/3 compatible branch. It seems to work on both Python 2.7 and 3.2, but I haven't thoroughly tested it. I've attempted to maintain compatibility with Python 2.6, at least.

I've obviously made no progress on this, too many other things to do, but very excited to see it happening - ping me if you want a few hours or less of specific bugfixes and testing.

Owner

inducer commented Jul 14, 2012

Great! I've taken a look at your work, and it works fine for me in 2.7 and 3.2 (with one minor fix). I've merged your changes and sent out a ping to the mailing list asking people to test current git. We'll let that simmer for a week or two, and then I'll simply make a release with your changes. If stuff turns out to be broken, I'm sure I'll hear about it then at the latest.

Thanks for your patch!
Andreas

inducer closed this Jul 14, 2012

@pvaret pvaret pushed a commit to pvaret/pudb that referenced this pull request Feb 13, 2015

@inducer inducer Revert "Insert 2to3 invocation into setup.py."
This reverts commit 4f913f6,
in accordance with the decision [1] to not use 2to3.

[1] inducer#1
aa5503d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment