Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Support Python 3.7 Generator (PEP 479) #153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Hanaasagi
Copy link

@Hanaasagi Hanaasagi commented Apr 17, 2019

resolves #152

PEP 479 is enabled for all code in Python 3.7, meaning that StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions.

@Hanaasagi
Copy link
Author

Hanaasagi commented Apr 17, 2019

Travis-CI failed because setuptools has dropped Python 3.3 since v40.0.0. See https://setuptools.readthedocs.io/en/latest/history.html#v40-0-0

cclauss added a commit to cclauss/line_profiler that referenced this pull request Jul 12, 2019
rkern#153 or similar is __required__ to be compatible with Python 3.7.
cclauss added a commit to cclauss/gryphon that referenced this pull request Jul 12, 2019
Without rkern/line_profiler#153 we need to run on Python 3.6, not 3.7
@cclauss
Copy link

cclauss commented Jul 12, 2019

@Hanaasagi Could you please try adding the .travis.yml file from #147 so we can see if the tests pass on Python 3.7?

@cclauss
Copy link

cclauss commented Jul 13, 2019

MAGIC!! Well done.

@Hanaasagi
Copy link
Author

Hanaasagi commented Jul 13, 2019

It failed again.

3.3 is not installed; attempting download
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/16.04/x86_64/python-3.3.tar.bz2
0.12s
$ curl -sSf -o python-3.3.tar.bz2 ${archive_url}
curl: (22) The requested URL returned error: 404 Not Found
Unable to download 3.3 archive. The archive may not exist. Please consider a different **version.**

@Hanaasagi
Copy link
Author

emm, It' seems my fault.

@cclauss
Copy link

cclauss commented Jul 13, 2019

Please drop both Python 3.3 and 3.4 because they are end of life.

It is not your fault. Travis CI no longer provides access to Python 3.3.

@Hanaasagi
Copy link
Author

It works.

@Zannick
Copy link

Zannick commented Jul 28, 2019

Should it also handle StopIteration on the first iterate? e.g.

93: try:
94:     item = next(g)
+   except StopIteration:
+       return
95: finally:
96:     ...

This is necessary in line_profiler.py for me, should probably also handle kernprof.py.

@Hanaasagi
Copy link
Author

Looks good.

@cclauss
Copy link

cclauss commented Jul 29, 2019

@caethan Can we please get these changes merged so that the current Python is supported?

@Erotemic
Copy link

Still waiting on this.

@cclauss
Copy link

cclauss commented Aug 15, 2019

@rkern Would you be willing to make @Hanaasagi a maintainer of this repo so we can get this landed?

@johanneswilm
Copy link

@rkern It would be really good to get this moving if possible.

@Erotemic
Copy link

@rkern This library has been failing to install on 3.7 for 6 months now. This PR fixes it, and has been ready for many months. Are you still maintaining this repo? Is there some timeline for merging and pushing up a new release? Do you need someone to take over this project?

@jberends
Copy link

this package seems dead to me.. Looking for alternatives as we speak.

@timabbott
Copy link

This package is quite good at what it does. I think given the lack of response from the maintainers, I think one can assume they're busy with other aspects of life, and it makes sense for someone to setup a maintained friendly fork. Normally I'd volunteer, but I don't have time to pick up another project right now.

@Mogost
Copy link

Mogost commented Dec 10, 2019

I would nominate @Hanaasagi for this role. Since he is quite active and it is his PR that we all need so much.

@Erotemic
Copy link

Erotemic commented Dec 10, 2019

I'll second @Hanaasagi but if they are unable, I'll volunteer. Perhaps it makes sense to setup a GitHub organization to maintain this project and have multiple people in this thread as maintainers of the repo. We could also probably ask pypi to transfer ownership of the line_profiler namespace to this group.

EDIT: I created a github organization called pyutils and I've forked this repo: https://github.com/pyutils/line_profiler. I've invited @Hanaasagi to be a member of the organization. If anyone else from this thread would like to be involved let me know and I'll send an invite. I think maintaining this repo will be much easier as a team effort than if a single person picked it up.

EDIT2:

I've merged this PR into the master branch of the fork: https://github.com/pyutils/line_profiler

I'm also creating a PR there to streamline the publishing to pypi process

I've created a pypi user to publish the package with: https://pypi.org/user/pyutils/

I've also requested the transfer of ownership here: pypi/support#103

@Hanaasagi
Copy link
Author

Thanks for the invitation. I have joined the organization.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.7 StopIteration exception
8 participants