line_profiler icon indicating copy to clipboard operation
line_profiler copied to clipboard

Support Python 3.7 Generator (PEP 479)

Open Hanaasagi opened this issue 6 years ago • 19 comments

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 avatar Apr 17 '19 06:04 Hanaasagi

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

Hanaasagi avatar Apr 17 '19 07:04 Hanaasagi

@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 avatar Jul 12 '19 20:07 cclauss

MAGIC!! Well done.

cclauss avatar Jul 13 '19 01:07 cclauss

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 avatar Jul 13 '19 01:07 Hanaasagi

emm, It' seems my fault.

Hanaasagi avatar Jul 13 '19 01:07 Hanaasagi

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

  • https://devguide.python.org/devcycle/#end-of-life-branches

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

cclauss avatar Jul 13 '19 01:07 cclauss

It works.

Hanaasagi avatar Jul 13 '19 02:07 Hanaasagi

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.

Zannick avatar Jul 28 '19 22:07 Zannick

Looks good.

Hanaasagi avatar Jul 29 '19 04:07 Hanaasagi

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

cclauss avatar Jul 29 '19 05:07 cclauss

Still waiting on this.

Erotemic avatar Aug 15 '19 22:08 Erotemic

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

cclauss avatar Aug 15 '19 23:08 cclauss

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

johanneswilm avatar Aug 19 '19 10:08 johanneswilm

@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?

Erotemic avatar Nov 22 '19 18:11 Erotemic

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

jberends avatar Dec 10 '19 19:12 jberends

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.

timabbott avatar Dec 10 '19 19:12 timabbott

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

Mogost avatar Dec 10 '19 19:12 Mogost

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: https://github.com/pypa/pypi-support/issues/103

Erotemic avatar Dec 10 '19 20:12 Erotemic

Thanks for the invitation. I have joined the organization.

Hanaasagi avatar Dec 13 '19 02:12 Hanaasagi