Skip to content

Drop versions earlier than Python 3.7 and update requirements #159

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

Closed
wants to merge 17 commits into from

Conversation

apalala
Copy link

@apalala apalala commented Oct 20, 2021

library upgrades

This update nominally drops support for Python 2.7, 3.5, and 3.6, and tests support for 3.10 to avoid libraries being pinned to very old versions, many of them with bugs or with security issues.

It's "nominally" because the code hasn't been changed except for deprecations enforced in Python 3.9 or 3.10.

disabled tests

Tests that required running test servers are disabled:

  • Running the servers locally is too complicated
  • There are no changes to the library's logic. Only required library versions were changed

The tests can be re-enabled by someone with access to test servers.

@apalala apalala self-assigned this Oct 20, 2021
.envrc Outdated
@@ -0,0 +1 @@
export SH_APIKEY=''
Copy link
Member

Choose a reason for hiding this comment

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

Why is this file Git-tracked?

Copy link
Author

Choose a reason for hiding this comment

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

It's to make it evident that some tests will fail if SH_APIKEY is defined in the environment, as is the case for most Zyte developers.

Copy link
Member

Choose a reason for hiding this comment

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

We could instead force this in tox, since tox is the standard way to run tests in this project.

This file would only be useful for developers using direnv, which may be or become true for most Zytans, but probably won’t for the wider open source community.

Copy link
Author

@apalala apalala Oct 25, 2021

Choose a reason for hiding this comment

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

I agree. I'll add the envvar to tox.ini and document that tox (and not pytest) should be use to run the tests.

setup.py Outdated
@@ -26,20 +26,20 @@
platforms=['Any'],
packages=['scrapinghub', 'scrapinghub.client', 'scrapinghub.hubstorage'],
package_data={'scrapinghub': ['VERSION']},
install_requires=['requests>=1.0', 'retrying>=1.3.3', 'six>=1.10.0'],
extras_require={'msgpack': mpack_required},
install_requires= mpack_required + [
Copy link
Member

Choose a reason for hiding this comment

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

Why is msgpack no longer optional?

Copy link
Author

Choose a reason for hiding this comment

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

shub doesn't work well without msgpack. Numerous requests for help on the #devel channel end up with "install msgpack, and get rid of mspack-python).

Copy link
Member

Choose a reason for hiding this comment

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

I have just found out that removing the entry from extras_require is backward incompatible, so I suggest we keep it with an empty list of requirements, as suggested in the setuptools documentation:

Best practice: if a project ends up not needing any other packages to support a feature, it should keep an empty requirements list for that feature in its extras_require argument, so that packages depending on that feature don’t break (due to an invalid feature name).

Copy link
Member

Choose a reason for hiding this comment

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

#164

(I would usually provide a suggestion, but I needed a fork I could clone for immediate usage)

@@ -177,6 +177,7 @@ def test_summary_countstart(hsproject):
[o['key'] for o in s2['summary'][-6:-3]])


@pytest.mark.skip(reason='Servers not running')
Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate? What do we need to do to get these tests working?

Copy link
Author

Choose a reason for hiding this comment

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

To run those tests we need a devbox.

Kumo has one or more of those, so they can help with the testing (access to an internal dev machine?) when the time is right.

Copy link
Author

Choose a reason for hiding this comment

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

Note that having tests that require a live box means that we couldn't run the tests in Github actions.

@jdemaeyer
Copy link

shub no longer works on Arch Linux as Python 3.10 landed in the official repos a week ago (breaking wihle trying to run the no-longer-possible imports from collections instead of collections.abc). There has been no activity on this PR for two months, any chance it will be merged soon?

@pawelmhm
Copy link
Member

pawelmhm commented Dec 27, 2021

we need to move this forward, tests are failing becuase of cassette replay problems. on storage.vm.scrapinghub. I'm not sure why we have to rely on making connections to some development server, this is a recipe for trouble, is there no way to fake tests here?

I also don't think we need to bother about upgrading all libraries and dropping python 2 support NOW. We need to have this working with python 3.10 asap and worry about other things later. I'll try to make other smaller PR with only essential things

(edited)

@apalala
Copy link
Author

apalala commented Dec 28, 2021

@pawelmhm, the upgrade on this pull request is all we need. I know because I've tested it enough.

Everything else can wait.

@elacuesta
Copy link
Member

Python 3.10 support added in #166

@elacuesta elacuesta closed this Mar 10, 2022
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.

5 participants