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

10249 Use enviroment markers for extra all #1656

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

Conversation

McSinyx
Copy link

@McSinyx McSinyx commented Aug 6, 2021

Scope and purpose

This will make it valid to install every extra on any platform. This sounds odd but it is a criteria we are experimentally mandate in IPWHL, a WIP downstream repository for Python packages.

Contributor Checklist:

  • The associated ticket in Trac is here: https://twistedmatrix.com/trac/ticket/10249
  • I ran tox -e lint to format my patch to meet the Twisted Coding Standard
  • I have created a newsfragment in src/twisted/newsfragments/ (see: News files)
  • The title of the PR starts with the associated Trac ticket number (without the # character).
  • I have updated the automated tests and checked that all checks for the PR are green.
  • I have submitted the associated Trac ticket for review by adding the word review to the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews now.
  • The merge commit will use the below format
    The first line is automatically generated by GitHub based on PR ID and branch name.
    The other lines generated by GitHub should be replaced.
Merge pull request #123 from twisted/4356-branch-name-with-trac-id

Author: <github_username>, <github_usernames_if_more_authors>
Reviewer: <github_username>, <github_username_if_more_reviewers>
Fixes: ticket:<trac_ticket_number>, ticket:<another_if_more_in_one_PR>

Long description providing a summary of these changes.
(as long as you wish)

@McSinyx McSinyx changed the title Use enviroment markers for extra all* 10249: Use enviroment markers for extra all* Aug 6, 2021
@McSinyx McSinyx force-pushed the markers branch 2 times, most recently from a4e3ff3 to 6d5985c Compare August 7, 2021 04:22
@McSinyx McSinyx changed the title 10249: Use enviroment markers for extra all* 10249: Use enviroment markers for extra all Aug 7, 2021
@McSinyx McSinyx requested a review from graingert August 10, 2021 05:08
@McSinyx
Copy link
Author

McSinyx commented Aug 29, 2021

Gentle ping!

setup.cfg Outdated
Comment on lines 108 to 117
all_non_platform =
%(all)s
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the update. I think that this is an important one.

I think that all_non_platform should be kept as it is (with test removed) and not install pywin32.

and maybe create something like _platform_specific and add it to the new all toge

all_non_platform =
  AS_BEFORE

_platform_specific =
    pyobjc-core; platform_system == "Darwin"
    pyobjc-framework-CFNetwork; platform_system == "Darwin"
    pyobjc-framework-Cocoa; platform_system == "Darwin"
    pywin32 != 226; platform_system == "Windows"

all =
    %(all_non_platform)s
    %(_platform_specifics)s

Does it make sense?

The concern raised by Thomas is that maybe you are already calling pip twisted[all_non_platform] on pypy on windows or macos and you might end up with a failure.


We don't have pypy test runs on macOS or Windows (I think that we should have at least one) so I don't know if that is the case.

But I think that is best to play it safe and keep all_non_platform is it was before.

Then we can add all or standard or any new extra :)

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for the late reply, do you think it would be preferable to use the macos_platform and macos_platform extra name or _platform_specific should be the way to go?

[installing] on pypy on windows or macos and you might end up with a failure.

Yup pyobjc and pywin32 looks like CPython extension modules, I think I'll go head and add platform_python_implementation == "CPython" to the marker.

@glyph
Copy link
Member

glyph commented Jan 15, 2022

Merging changes back to the branch appears to be disabled so I can't update it for current trunk.

@McSinyx
Copy link
Author

McSinyx commented Jan 15, 2022

I've rebased it on top of trunk.

Copy link
Contributor

@twm twm left a comment

Choose a reason for hiding this comment

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

I had a minor note, but even so this looks like a real improvement and I'd like to merge it. Unfortunately it has drifted from trunk once more. Could you merge/rebase again?

docs/installation/howto/optional.rst Outdated Show resolved Hide resolved
@adiroiban
Copy link
Member

The changes looks good.

We have the deprecation info in the release notes. That is great.

We also raises deprecation warnings for things that are deprecated... so that people will that don't read the release notes will know what was changed.

Is there an easy way in which a deprecation error can be raised for using a specific extra?

I guess that we can try to keep them deprecated and without removal for as long as we can.

I guess that you can include a package that once installed it will trigger a deprecation warning...but looks complicated.


so @graingert any comments on the current PR?

Can it be merged?

Thanks!

@twm
Copy link
Contributor

twm commented Feb 11, 2022

@adiroiban I think the hold-up here is entirely that Twisted maintainers can't merge/rebase it easily, so it drifts out of sync with trunk. (Well, and now there are conflicts.) I'd have merged it a month ago otherwise.

@McSinyx McSinyx force-pushed the markers branch 2 times, most recently from 99794f8 to 181e56a Compare February 11, 2022 06:48
@adiroiban adiroiban removed the request for review from graingert February 11, 2022 11:41
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Many thanks for the update.

As commented by Thomas over gitter, all_non_platform should also install test as it was doing in the past to keep backward compatibility.

I left more comments inline.

auto-merge was automatically disabled February 11, 2022 18:49

Head branch was pushed to by a user without write access

Optional dependencies in test are also moved from all to dev,
and all is now included in dev for convenience.
@adiroiban
Copy link
Member

@graingert ... so. Thomas. Anything bad with this PR? Are you happy to see it merged?

Right now the PR is blocked as you have previously rejected the changes.

Thanks!

@adiroiban adiroiban requested a review from a team July 8, 2022 10:04
@adiroiban adiroiban changed the title 10249: Use enviroment markers for extra all 10249 Use enviroment markers for extra all Aug 24, 2022
@adiroiban adiroiban mentioned this pull request Sep 12, 2022
4 tasks
Copy link
Member

@glyph glyph left a comment

Choose a reason for hiding this comment

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

Sorry to see that this has drifted out of sync with trunk yet again, probably due to the big packaging overhaul. Hopefully that means that this will be easier to do, if somewhat annoying that it all needs to be done again.

Comment on lines -18 to -24
* **dev** - packages that aid in the development of Twisted itself.
tls
Packages that are needed to work with TLS:

* `pyflakes`_
* `twisted-dev-tools`_
* `python-subunit`_
* `Sphinx`_
* `TwistedChecker`_, only available on python2
Copy link
Member

Choose a reason for hiding this comment

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

Not the responsibility of this change, but, I think that we should not actually re-enumerate all dependencies in this document any more. Just list the extras, and let the package metadata speak for itself if people want to know specifics. We can't necessarily keep this up to the minute up-to-date if someone adds a transitive dependency, for example.

@glyph glyph removed the request for review from graingert November 22, 2022 19:35
@glyph
Copy link
Member

glyph commented Nov 22, 2022

Note that you can ask the robot for a re-review at any time by saying "p-l-e-a-s-e review" without the dashes.

@glyph glyph requested review from twm and removed request for twm November 22, 2022 19:35
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.

None yet

6 participants