Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

towncrier is broken on Python 2.7 #121

Closed
exarkun opened this issue Aug 1, 2018 · 3 comments
Closed

towncrier is broken on Python 2.7 #121

exarkun opened this issue Aug 1, 2018 · 3 comments

Comments

@exarkun
Copy link
Member

exarkun commented Aug 1, 2018

$ towncrier --draft
Loading template...
Finding news fragments...
Rendering news fragments...
Traceback (most recent call last):
  File ".../bin/towncrier", line 11, in <module>
    sys.exit(_main())
  File ".../lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File ".../lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File ".../lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File ".../lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File ".../lib/python2.7/site-packages/towncrier/__init__.py", line 54, in _main
    draft, directory, project_name, project_version, project_date, answer_yes
  File ".../lib/python2.7/site-packages/towncrier/__init__.py", line 93, in __main
    fragments = split_fragments(fragments, definitions)
  File ".../lib/python2.7/site-packages/towncrier/_builder.py", line 87, in split_fragments
    content = textwrap.indent(content.strip(), "  ")[2:]
AttributeError: 'module' object has no attribute 'indent'
@exarkun
Copy link
Member Author

exarkun commented Aug 1, 2018

As a result, it is impossible to use towncrier with Python 2-only software. This seems like an unfortunate and unnecessary circumstance.

@tardyp
Copy link
Contributor

tardyp commented Sep 6, 2018

Would appreciate a release.
Pyup keep upgrading to 18.6.0 just after we release and we don't have newsfragment yet :)

@mauritsvanrees
Copy link
Contributor

👍 for making a new release that works on Python 2.

mauritsvanrees added a commit to plone/plone.releaser that referenced this issue Aug 21, 2019
This happens for lines with an '=' like this:

[versionannotations:python27]
towncrier =
    18.6.0 does not work on Python 2, see twisted/towncrier#121
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Aug 29, 2019
Branch: refs/heads/master
Date: 2019-08-17T00:26:23+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@f0d5021

Ran black.

Black sees a SyntaxError in changelog.py, so that one is not changed.

Files changed:
M bootstrap.py
M plone/__init__.py
M plone/releaser/__init__.py
M plone/releaser/buildout.py
M plone/releaser/db.py
M plone/releaser/manage.py
M plone/releaser/package.py
M plone/releaser/pypi.py
M plone/releaser/release.py
M setup.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:28:27+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@10513b2

Fixed old-style exceptions in changelog.py

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:28:36+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@27f43e2

Ran black on changelog.py.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:37:50+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@34004c2

Call sources.items instead of iteritems.

iteritems does not exist in Python 3.

Files changed:
M plone/releaser/manage.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:38:08+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@7179ec3

Use a urlopen that works in Python 2 and 3.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:40:33+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@2b62ded

changelog DIST_URL: use https.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T01:02:18+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@8c90f40

Ran python-modernize.

https://docs.plone.org/manage/upgrading/version_specific_migration/upgrade_to_python3.html#automated-fixing-with-modernize

Some manual edits, because I got 'print((...))' and python 2 imports in a try/except ImportError were replaced with six.

Files changed:
M plone/releaser/buildout.py
M plone/releaser/changelog.py
M plone/releaser/manage.py
M plone/releaser/package.py
M plone/releaser/pypi.py
M plone/releaser/release.py
M setup.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T22:50:26+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@1e047b7

Fixed bytes/unicode error in 'manage changelog'.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T22:54:21+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@72e6620

changelog: output string does not need to be encoded.

Otherwise you get an ugly one-liner with b'' on Python 3.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T23:13:02+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@c6142c3

changelog: ignore packages without version.

This happens for lines with an '=' like this:

[versionannotations:python27]
towncrier =
    18.6.0 does not work on Python 2, see twisted/towncrier#121

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T23:22:12+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@885cc54

Fixed TypeError in manage changelog.

Not all versions can be compared.
We might need to switch from distutils.LooseVersion to something from setuptools.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-22T17:45:01+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@9182d3f

Fixed ugly bytes representation in commit report.

Files changed:
M plone/releaser/package.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-22T17:50:41+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@de4f829

Added news snippet for issue 25.

Files changed:
A news/25.bugfix
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-29T20:21:01+02:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: plone/plone.releaser@fa57959

Merge pull request #26 from plone/maurits-issue-25-python3

[WIP] Fix Python 3 compatibility

Files changed:
A news/25.bugfix
M bootstrap.py
M plone/__init__.py
M plone/releaser/__init__.py
M plone/releaser/buildout.py
M plone/releaser/changelog.py
M plone/releaser/db.py
M plone/releaser/manage.py
M plone/releaser/package.py
M plone/releaser/pypi.py
M plone/releaser/release.py
M setup.py
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Aug 29, 2019
Branch: refs/heads/master
Date: 2019-08-17T00:26:23+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@f0d5021

Ran black.

Black sees a SyntaxError in changelog.py, so that one is not changed.

Files changed:
M bootstrap.py
M plone/__init__.py
M plone/releaser/__init__.py
M plone/releaser/buildout.py
M plone/releaser/db.py
M plone/releaser/manage.py
M plone/releaser/package.py
M plone/releaser/pypi.py
M plone/releaser/release.py
M setup.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:28:27+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@10513b2

Fixed old-style exceptions in changelog.py

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:28:36+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@27f43e2

Ran black on changelog.py.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:37:50+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@34004c2

Call sources.items instead of iteritems.

iteritems does not exist in Python 3.

Files changed:
M plone/releaser/manage.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:38:08+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@7179ec3

Use a urlopen that works in Python 2 and 3.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T00:40:33+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@2b62ded

changelog DIST_URL: use https.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-17T01:02:18+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@8c90f40

Ran python-modernize.

https://docs.plone.org/manage/upgrading/version_specific_migration/upgrade_to_python3.html#automated-fixing-with-modernize

Some manual edits, because I got 'print((...))' and python 2 imports in a try/except ImportError were replaced with six.

Files changed:
M plone/releaser/buildout.py
M plone/releaser/changelog.py
M plone/releaser/manage.py
M plone/releaser/package.py
M plone/releaser/pypi.py
M plone/releaser/release.py
M setup.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T22:50:26+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@1e047b7

Fixed bytes/unicode error in 'manage changelog'.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T22:54:21+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@72e6620

changelog: output string does not need to be encoded.

Otherwise you get an ugly one-liner with b'' on Python 3.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T23:13:02+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@c6142c3

changelog: ignore packages without version.

This happens for lines with an '=' like this:

[versionannotations:python27]
towncrier =
    18.6.0 does not work on Python 2, see twisted/towncrier#121

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-21T23:22:12+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@885cc54

Fixed TypeError in manage changelog.

Not all versions can be compared.
We might need to switch from distutils.LooseVersion to something from setuptools.

Files changed:
M plone/releaser/changelog.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-22T17:45:01+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@9182d3f

Fixed ugly bytes representation in commit report.

Files changed:
M plone/releaser/package.py
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-22T17:50:41+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.releaser@de4f829

Added news snippet for issue 25.

Files changed:
A news/25.bugfix
Repository: plone.releaser

Branch: refs/heads/master
Date: 2019-08-29T20:21:01+02:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: plone/plone.releaser@fa57959

Merge pull request #26 from plone/maurits-issue-25-python3

[WIP] Fix Python 3 compatibility

Files changed:
A news/25.bugfix
M bootstrap.py
M plone/__init__.py
M plone/releaser/__init__.py
M plone/releaser/buildout.py
M plone/releaser/changelog.py
M plone/releaser/db.py
M plone/releaser/manage.py
M plone/releaser/package.py
M plone/releaser/pypi.py
M plone/releaser/release.py
M setup.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants