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 force-pushed the tox branch 2 times, most recently from 1d3f867 to d86471b Compare December 16, 2022 19:08
@lengau lengau marked this pull request as ready for review December 16, 2022 20:44
@lengau lengau force-pushed the tox branch 6 times, most recently from c428d99 to 1343cfe Compare January 12, 2023 04:00
@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

@lengau lengau force-pushed the tox branch 2 times, most recently from 0b9abd5 to fbd1b00 Compare January 12, 2023 15:36
lengau added 17 commits January 12, 2023 16:15
* 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.

4 participants