Skip to content

ENH: Add entry_points for f2py, conv_template, and from_template.#10463

Merged
charris merged 4 commits intomasterfrom
unknown repository
Jan 30, 2018
Merged

ENH: Add entry_points for f2py, conv_template, and from_template.#10463
charris merged 4 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jan 23, 2018

I couldn't shoehorn entry_points into the configuration object.

Closes gh-10462.

@ghost ghost changed the title WIP: Add entry_points Add entry_points Jan 24, 2018
@ghost ghost changed the title Add entry_points ENH: Add entry_points for f2py and conv_template Jan 24, 2018
@rgommers
Copy link
Copy Markdown
Member

@xoviat it would be really helpful to get a higher level description with these kinds of PRs. E.g. what's the improvement for an end user? is this only an update to more recent packaging practices or does it fix an open issue?

@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 24, 2018

NumPy still uses the old "scripts" mechanism, which was deprecated in favor of entry_points. The reason is that entry_points are less fragile and more reliable than scripts.

@eric-wieser
Copy link
Copy Markdown
Member

which was deprecated in favor of entry_points

I assume this is a setuptools change, not a distutils one? Which version of setuptools introduced that feature?

@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 25, 2018

That was pypa/setuptools@1c40632

@rgommers
Copy link
Copy Markdown
Member

In principle +1 on this change.

We've had a lot of issues with f2py not being available, IIRC especially on Windows. So this needs quite a bit of testing on various OSes and install from wheel, sdist and direct build.

@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 29, 2018

So this needs quite a bit of testing on various OSes and install from wheel, sdist and direct build.

Note: this doesn't need any additional testing because entry_points is a setuptools feature that is already well-tested. There is no reason that the NumPy use-case would be different than the use case for other projects.

entry_points={
'console_scripts': [
'f2py = numpy.f2py.__main__:main',
'conv-template = numpy.distutils.conv_template:main',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conv-template or conv_template?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other scripts, should they be added also?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Command names usually contain dashes.
  2. Which other scripts are there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is from_template.py, used by f2py and cythonize.py. I'm not clear just what needs an entry point or why. Note that process_file is the part of conv_template that is actually imported and used in the build, conv_template is used as a module rather than a script.

@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 30, 2018

@charris I've added from_template as well.

@charris charris changed the title ENH: Add entry_points for f2py and conv_template ENH: Add entry_points for f2py, conv_template, and from_template. Jan 30, 2018
@charris
Copy link
Copy Markdown
Member

charris commented Jan 30, 2018

AFAICT, this can't hurt, so let's give it a shot. Thanks @xoviat.

I do have a question, does this work on windows? Google indicates that the setting of the path variable can make a difference.

@charris charris merged commit bb7b126 into numpy:master Jan 30, 2018
@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 30, 2018

I do have a question, does this work on windows?

Yes.

@ghost ghost deleted the entry-points branch January 30, 2018 23:34
hanjohn pushed a commit to hanjohn/numpy that referenced this pull request Feb 15, 2018
…mpy#10463)

* Add entry points for f2py and conv-template

* Add main function to conv_template

* Extract function

* Add entry point
charris added a commit to charris/numpy that referenced this pull request Aug 12, 2018
The changes introduced in numpy#10463 caused f2py to hang in somde
circumstances. There is may a better fix than this, but
until it is implemented it is better to undo the change.

Closes numpy#11649.
charris added a commit to charris/numpy that referenced this pull request Aug 16, 2018
The changes introduced in numpy#10463 caused f2py to hang in somde
circumstances. There is may a better fix than this, but
until it is implemented it is better to undo the change.

Closes numpy#11649.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants