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

Enhacements: simplify Travis-CI configuration using tox and enable running same tests locally #320

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

Conversation

ssato
Copy link
Contributor

@ssato ssato commented Sep 11, 2020

This is another trial to add tox.ini to yamllint (previous one is pr #313).

This PR consists of the commits do followings.

  1. Add tox.ini and requirements.txt for pip: This is similar to pr enhancement: make possible to run tests and related stuff using tox #313 but also should enables that developers can run almost same tests running in Travis-CI locally.
  2. Simplify Travis-CI configuration utilizing tox.
  3. Optional change to do similar CI using GitHub Actions instead of Travis-CI to reduce risk of strong dependency to specific CI web service only.

Make possible to run tests (python setup.py test) and other related
stuff (flake8, doc8 and yamllint) using tox.

Signed-off-by: Satoru SATOH <[email protected]>
Utilize tox in travis-ci to simplify its configuration.

Signed-off-by: Satoru SATOH <[email protected]>
Add github actions (gh) configuration file and update tox.ini to add
gh related configurations.
@ssato
Copy link
Contributor Author

ssato commented Sep 11, 2020

FYI. Here are some example CI results after these changes are made.

@adrienverge
Copy link
Owner

Thanks @ssato, I've carefully reviewed your PR, it looks good, but as stated in #313 I prefer to keep the repo as simple as possible for non-Pythoners, non-tox-users.

@ssato
Copy link
Contributor Author

ssato commented Sep 14, 2020

Very sorry to bother you but could you please let me clarify what do you mean by "to keep the repo as simple as possible for non-Pythoners, non-tox-users" ?

Firstly, I don't understand who that simplicity of the repo for you intend to. As I noted tox is not for ordinal users, maybe non-Pythoners, who just want to install yamllint using pip or something, use it and maybe never look at this repo. Tox is purely for developers who want to fix and/or improve yamllint code and test it in isolated and clean environments to avoid specific issues because of their environments. Yamllint is written in python, so, inevitably, developers know python and how to use tox somewhat, I guess. Also, because you embed the several steps to test yamllint code into .travis.yml which is not fully consistent with the steps explained in CONTRIBUTING.rst, it's not simple for developers including me to test modified yamllint code in an isolated and clean environment or environments in which multiple different versions of pythons are installed consistently. In other words, the simplicity of the repo by not adding just a few small files you're particular about does not bring any benefits for such developers, IMHO.

Next, tox is not a minor tool, AFAIK. It seems popular enough and adopted in many python oss projects already. For example, flask, jinja2, click, scrapy, certbot look using it. I don't insist that all python developers know and familiar with tox but guess that many python oss developers have seen it in other oss projects and have used it before perhaps. Also, some developers (non-tox-users) can choose not using tox and run the testing steps in CONTRIBUTING.rst manually. For this, I splitted the change into some commits on purpose.

@adrienverge
Copy link
Owner

Very sorry to bother you but could you please let me clarify what do you mean by "to keep the repo as simple as possible for non-Pythoners, non-tox-users" ?

Sure, I mean to have as few non-required files as possible, and also as few external tools/dependencies as possible, so it's easy for a new beginner to understand in which file to start. I feel that CONTRIBUTING.rst is simple and consistent, but feel free to propose suggestions.

test it in isolated and clean environments to avoid specific issues because of their environments

This applies to many Python projects, but do you have a problem example for yamllint? This project has very few dependencies (2), hence should hardly depend on the users environments.

Yamllint is written in python, so, inevitably, developers know python and how to use tox somewhat, I guess.

If you look at PRs in this project, you'll see that quite a few were written by non-Pythoners (some were their first writing of Python code!)

Next, tox is not a minor tool, AFAIK. It seems popular enough and adopted in many python oss projects already.

I've used tox for years and I know how useful it is for projects like OpenStack, Flask, etc.
It's on purpose (simplicity to understand the repo) that it's not in use in this small and simple project.

@ssato
Copy link
Contributor Author

ssato commented Sep 15, 2020

Thanks for your quick response! I really appreciate you have taken time for all of my proposals.

test it in isolated and clean environments to avoid specific issues because of their environments

This applies to many Python projects, but do you have a problem example for yamllint? This project has very few dependencies (2), hence should hardly depend on the users environments.

My own problem is that I cannot test it after my modifications made easily with just single command (like 'tox -e py36) instead of a series of commands, e.g. virtualenv ...; source .... /bin/activate; ...; python setup.py test, in my development environment before submitting PR. I'm running Fedora for my daily work and hacks in my spare time and Fedora should not be so popular compared to others like macOS and ubuntu, AFAIK, so I want t make sure that I did not bring any regressions or issues because of my modifications before I submit PR and the CI service letting me know about it.

@bristea
Copy link

bristea commented Oct 10, 2020

My own problem is that I cannot test it after my modifications made easily with just single command
Is not your unique problem, I would say that almost anyone that is able to edit Python code knows what tox is and how to use it. IMHO, Yamllint would become far more welcoming for PRs if it would have a tox file, not the other way around.

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.

None yet

3 participants