8000 Refactor QA setup by aleksihakli · Pull Request #610 · jazzband/sorl-thumbnail · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Refactor QA setup #610

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

Merged
merged 1 commit into from
Jan 21, 2020
Merged

Refactor QA setup #610

merged 1 commit into from
Jan 21, 2020

Conversation

aleksihakli
Copy link
Member
@aleksihakli aleksihakli commented Jan 16, 2020

Fixes jazzband/help#182

Some notable changes:

  • Deprecate explicit support for Python 3.4 and 3.5 in order to simplify the test matrix.
  • Clean up the test runner setup with tox and Travis

@jezdez
Copy link
Member
jezdez commented Jan 16, 2020

Thanks @aleksihakli, but this needs a Python environment list still, check out the constance config: https://github.com/jazzband/django-constance/blob/master/.travis.yml

@aleksihakli
Copy link
Member Author

@jezdez Python version list is now included in .travis.yml.

@aleksihakli aleksihakli changed the title Fix Travis Jazzband deployments Refactor the tests to use tox-travis Jan 16, 2020
@coveralls
Copy link

Coverage Status

Coverage remained the same at ?% when pulling a552836 on aleksihakli:master into 13bedfb on jazzband:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at ?% when pulling a552836 on aleksihakli:master into 13bedfb on jazzband:master.

@coveralls
Copy link
coveralls commented Jan 16, 2020

Coverage Status

Coverage remained the same at ?% when pulling 78b86de on aleksihakli:master into 13bedfb on jazzband:master.

@jezdez
Copy link
Member
jezdez commented Jan 16, 2020

I'm sorry, I wasn't clear about what I mean, tox-travis is best set up in using per-Python version test harnesses like in https://github.com/jazzband/django-constance/blob/b62206da573c1447b79ebc95a430df809672092d/.travis.yml#L3-L8.

@aleksihakli
Copy link
Member Author
aleksihakli commented Jan 16, 2020

@jezdez I made an intermittent commit with the Python version listing as usual in Django projects and tox-travis but it didn't bring much joy as the test matrix involved is more complex than a pair of (Python, Django) requirements.

It also includes other 3rd party packages such as Pillow or Boto and the matrix configuration then becomes (Python, Django, Package).

Thus the the test matrix definition is essentially the same size, but the Python variables will be introduced twice in the python definition as well as matrix definition on the top level of .travis.yml.

The problem is that there needs to be a way to specify the Django 10000 AND package versions along with the Python version with tox-travis or otherwise the matrix configuration can not be simplified that much if we want to test the packages as defined here.

It would of course be possible to define multiple environment variables where one is e.g. DJANGO and another is PACKAGE, but manually including or excluding test matrix cells in such a configuration creates essentially the same structure.

I have previously configured simple matrices and am familiar with them and tox-travis but didn't find any nice ways for defining more complex matrices in Travis. It would be nice to see such as configuration in action if someone has made one.

@aleksihakli
Copy link
Member Author

Just as a clarification: using the python keyword and the jobs.include (or matrix.include) will define both the Python versions and the additional matrix elements, so no joy there:

image

@aleksihakli aleksihakli changed the title Refactor the tests to use tox-travis Refactor test setup Jan 17, 2020
@aleksihakli
Copy link
Member Author

@jezdez I think the configuration is more to your liking now, figured out how to configure the matrix in a way that should fit this project and the requirements. Also added setuptools_scm to the mix to reduce the burden of remembering to update the sorl.__version__ for every release separately.

@camilonova the test bench should work now and only do one deployment per tag utilizing the Travis job stages. The setups should also auto-version now as long as the git tags are in place :)

I think that it's best to explicitly exclude combinations with jobs.exclude or matrix.exclude from this configuration if necessary, but otherwise test all the combinations of Python, Django and 3rd party tool versions, as comprehensive testing costs very little and makes me happy, but mistakes might incite the frowning of package users.

@aleksihakli
Copy link
Member Author

@jezdez @camilonova the work in this PR is now ready for review and possible upstreaming work-wise, I'm done with iterating over it.

There are a lot of changes in this one PR and patch, but they all relate to CI, testing, and versioning. Splitting them up doesn't really simplify things, as it's easiest to see and review their correlation at once.

All the changes aside from the setuptools_scm and versioning tune-up are required or nice-to-have for a functioning Python 3 test and build setup for the project.

The docs were also broken on Python 3 due to the use of xrange, and I decided it would be nice to fix them in the same instance. Due to the fixes it might necessary to update RTD configuration to Python 3 and newer Sphinx version. I tested building the docs with Python 3.7 and Sphinx 2.3 and fixed a few warnings in the process.

8000

@aleksihakli aleksihakli changed the title Refactor test setup Refactor QA setup Jan 17, 2020
Copy link
Member
@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

This looks good but need a few minor updates.

@aleksihakli
Copy link
Member Author

@jezdez requested changes are implemented now.

@jezdez
Copy link
Member
jezdez commented Jan 21, 2020

@aleksihakli Sorry, this needs another pass for the sorl.__version__ parameter.

- Use setuptools_scm for deployment version number inference.
- Only run deployment once after all tests have passed.
- Skip deployment on existing packages on PyPI mirror.
- Deprecate EOL Python versions from the codebase.
- Utilize tox-travis and Travis test matrices.
- Clean up test scripts and definitions.

Fixes jazzband/help#182
@aleksihakli
Copy link
Member Author 9E19

@jezdez sorl.__version__ is now correctly configured.

Copy link
Member
@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Thank you!

@benjaoming
Copy link
Contributor
benjaoming commented Jan 23, 2020

I forgot to say thanks for the work to @aleksihakli 🙏 - agree on @jezdez's reasoning to remove 3.4 and 3.5 support, just think it'd be best to separate, so that the previously tagged 0.12.6 patch release (adding Django 3.0 support) could be released without the backwards incompatible and non-warned parts.

Maybe someone can upload 0.12.6 manually?

I think the PR description could be upgraded so a patch release isn't let out that removes Python 3.4 and 3.5 support.

Seems ideal for a 0.13 release, and perhaps most people would have their problems fixed if 0.13 could be immediately released from this PR?

CC: @camilonova

@aleksihakli
Copy link
Member Author
aleksihakli commented Jan 23, 2020

@benjaoming it's probably easier to just release 13.0.0 as that's most sane release scheme according to Semantic Versioning https://semver.org/?

I think that 12.6.0 can just be skipped if it's not vital to release it? If it's not uploaded to PyPI then there's no harm done :)

@benjaoming
Copy link
Contributor

@Aleksandar-Todorovic there are probably thousands of projects dependent on sorl-thumbnail, a few of which might be reusable apps trying to introduce Django 3.0 support in a complicated/diverse set of Django and Python support and release cycles.

Django 2.2 is still active, and so is Python 3.5.

If sorl-thumbnail skips 0.12.6 and removes Python 3.4 and 3.5 support, then we either have to go and create nitty-gritty conditional dependencies in setup.py or we have to drop our own Python 3.5 support out of the blue. This just adds more work for others with no gains.

Since there were no changes in the code, and the PR description says

Deprecate explicit support for Python 3.4 and 3.5 in order to simplify the test matrix.

...I think the correct thing to do would be to reinstate Python 3.4 and 3.5 support in setup.py and release these changes as 0.12.7

This could well be the final release in the 0.12 series before moving on to a 0.13 series w/o Py 3.4 and 3.5?

@jezdez
Copy link
Member
jezdez commented Jan 23, 2020

@Aleksandar-Todorovic there are probably thousands of projects dependent on sorl-thumbnail, a few of which might be reusable apps trying to introduce Django 3.0 support in a complicated/diverse set of Django and Python support and release cycles.

For the record, the number of apps that refer to sorl-thumbnail as a dependency is 15 according to libraries.io.

Django 2.2 is still active, and so is Python 3.5.

If sorl-thumbnail skips 0.12.6 and removes Python 3.4 and 3.5 support, then we either have to go and create nitty-gritty conditional dependencies in setup.py or we have to drop our own Python 3.5 support out of the blue. This just adds more work for others with no gains.

Since there were no changes in the code, and the PR description says

Deprecate explicit support for Python 3.4 and 3.5 in order to simplify the test matrix.

...I think the correct thing to do would be to reinstate Python 3.4 and 3.5 support in setup.py and release these changes as 0.12.7

This could well be the final release in the 0.12 series before moving on to a 0.13 series w/o Py 3.4 and 3.5?

@aleksihakli
Copy link
Member Author

@benjaoming if you want Python 3.4 and 3.5 supported please feel free to add them to the package identifiers and test matrix!

I don't have much opinions on it other than Python 3.4 is officially EOL.

Python 3.5 is also decreasing in usage and I have to say that the people who run old Python versions are rarely running the latest library or framework versions.

However, adding back the identifiers is easy enough, please do so if you feel that is the best solution. I am not the maintainer, I just try to actively improve Jazzband QA automation and dream of deprecating Python versions prior to 3.6 due to feature parity :)

@benjaoming
Copy link
Contributor
benjaoming commented Jan 23, 2020

Sounds good @aleksihakli , thanks for fixing all this!

Sorry, I have been writing the wrong version numbers consistently in this thread! 12.7 would be a fine release according to semver for the dropped Python support. I think 12.6.1 would a be a correct bump for a release with these fixes, apart from the dropped Python support.

I'll add a PR nominating master to move to a 12.6.1 release as a step before 12.7.

benjaoming added a commit to benjaoming/sorl-thumbnail that referenced this pull request Jan 23, 2020
benjaoming added a commit to benjaoming/sorl-thumbnail that referenced this pull request Jan 23, 2020
benjaoming added a commit to benjaoming/sorl-thumbnail that referenced this pull request Jan 23, 2020
@aleksihakli
Copy link
Member Author

@benjaoming roger that, although I'm not Aleksandar.

@benjaoming
Copy link
Contributor

haha, no, it was the first "aleks" auto-suggestion for @ -- Github still fails to put OP first :/

@camilonova
Copy link
Member

@aleksihakli @jezdez love you folks ❤️

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.

Pypi uploading is not working from Travis
5 participants
0