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

MAINT: Apply black, isort, pre-commit #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MartinThoma
Copy link

MAINT: Move meta-data to setup.cfg

MAINT: Move meta-data to setup.cfg
@MartinThoma
Copy link
Author

I highly recommend to install pre-commit: https://pre-commit.com/

pip install pre-commit

Once you have it on your system, you can go in this repository (this branch) and execute "pre-commit install". The effect is, that every time you execute "git commit" it will run all the checks I defined in the pre-commit file. This allows you to keep a high quality.

@MartinThoma
Copy link
Author

Also, I would recommend to drop Python 2 support. Python 2 is outdated. Two nice features you can use when you drop Python < 3.6 support:

  • f-strings
  • type annotations (not only as comments, but a nice integration) and checks with mypy

@Kamaropoulos
Copy link
Owner

Hello @MartinThoma!

Thanks a lot for the PR. I'll check it out asap!

Now, as about Python 2.x support, since requests is the only dependency of the library for now and it's not using any Python 3 exclusive features, I thought it could support every version supported by requests. This way, even someone that is still using Python 2, they'd still be able to use the package for whatever needs they might have.
Considering the scale of the crisis this package has to do with, I believe it's not as much about enforcing guidelines to the users but mostly wide support for anyone that might actually need it. 🙂

@MartinThoma
Copy link
Author

Your decision :-) - the main point is that it puts more work on your side.

This PR should not break Python 2 compatibility. Although I don't support Python 2 in my projects anymore, I respect the decision of other developers to keep compatibility. The last weeks I was supporting a few biochemistry projects to make them work in Python 3 additionally to Python 2. My hope is that we, as a community, can let Python 2 die. It's been around since 2008; Python 3.6 since 2016. All important projects I know of support Python 3.6 (various interpreters/platforms, various packages). If we can get rid of Python 2, we free up a lot of developer capacity.

By the way, I'm not arguing to deliberately break stuff. I'm arguing for not spending more time on keeping compatibility. In my case, I dropped Python 2.7 from my CI pipelines.

Speaking of CI pipelines: I don't see any in this project. Are you interested in setting one up with https://travis-ci.org/? I can make another PR after this one. It would automatically run the tests and check if it still works for all supported Python versions. You would see another check for new PRs which tells you if the PR breaks anything.

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

Successfully merging this pull request may close these issues.

2 participants