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

Testing: Lint and test using Tox #4005

Merged
merged 33 commits into from Jan 14, 2023
Merged

Testing: Lint and test using Tox #4005

merged 33 commits into from Jan 14, 2023

Conversation

lengau
Copy link
Contributor

@lengau lengau commented Dec 16, 2022

Configures tox for linting and unit testing and provides a GitHub workflow for running Tox.

Does not disable old linting and testing yet for the sake of comparison.

(CRAFT-1513)

@lengau lengau marked this pull request as draft December 16, 2022 18:47
@lengau lengau marked this pull request as ready for review December 16, 2022 20:44
@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2023

Codecov Report

Merging #4005 (4526909) into main (c1e240c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #4005   +/-   ##
=======================================
  Coverage   91.61%   91.61%           
=======================================
  Files          77       77           
  Lines        5153     5153           
=======================================
  Hits         4721     4721           
  Misses        432      432           
Impacted Files Coverage Δ
snapcraft/os_release.py 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

* Add tox >= 4.0 as a dev dependency
* Add tox configuration to setup.cfg
  - I chose setup.cfg because pyproject.toml support in tox is awkward (tox-dev/tox#999)
  - Specified flake8 < 6.0.0 until we can get around to replacing type comments with type annotations.
    PyCQA/pyflakes#747
* Modify Makefile to use tox instead of running the commands directly
* Update .gitignore for relevant new files and directories
* Update requirements files
  - Newer tarball in freeze-requirements.sh because the older one was sometimes breaking in tox.
* Set pylint configuration to ignore tests/legacy rather than manually excluding it

A future commit will configure tox in Github actions.
Takes advantage of the multiple python versions now available.
https://github.com/actions/setup-python/releases/tag/v4.4.0
Pylint fails on pydantic stuff if pydantic isn't installed
Also reduce python version to 3.10
# Conflicts:
#	Makefile
#	pyproject.toml
#	setup.py
.github/workflows/tox.yaml Show resolved Hide resolved
.github/workflows/tox.yaml Show resolved Hide resolved
requirements-devel.txt Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
Copy link
Collaborator

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Great work!

.github/workflows/tox.yaml Show resolved Hide resolved
Copy link
Contributor

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

nice!

@mr-cal mr-cal enabled auto-merge (squash) January 13, 2023 23:01
@mr-cal mr-cal merged commit 5e14f6d into canonical:main Jan 14, 2023
@lengau lengau deleted the tox branch January 14, 2023 00:56
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

4 participants