tox-gh-actions | Seamless integration of tox into GitHub Actions | Continuous Deployment library
kandi X-RAY | tox-gh-actions Summary
kandi X-RAY | tox-gh-actions Summary
Seamless integration of tox into GitHub Actions
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Configures the given configuration
- Determine if a container is running on a container
- Return True if the current action is running on actions
- Return the keys of the python version
- Get a list of environment variables from a list of factors
- Check if log grouping is enabled
- Checks to see if the given config option is set
- Parse Git - actions configuration
- Get a list of factors for the given versions
- Parse a dict value into a dictionary
- Show deprecation warning
- Cleanup problem matcher
- Get list of problem matcher owner
- Start tox
- Start grouping if necessary
- Run tox
- Create tox environment
- Install dependencies for the given virtualenv
tox-gh-actions Key Features
tox-gh-actions Examples and Code Snippets
Community Discussions
Trending Discussions on tox-gh-actions
QUESTION
I am trying to use tox-gh-actions to automate testing on github pushes. In order to test the implementation, I am locally using tox with setup.cfg, command I use python -m tox
but I always end up with the error:
ANSWER
Answered 2021-Sep-30 at 14:31Note that setup.cfg requires the content to be under the tox:tox and testenv sections and is otherwise ignored.
Source: https://tox.readthedocs.io/en/latest/config.html#configuration-discovery
QUESTION
I have a python package, and I am using poetry
for dependency management and packaging.
In my local environment, I am using tox
to test the package in multiple python version.
How can I use GitHub actions to test my package, everytime there is a push or pull request ?
Things that I have tried:
- https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml
(this official action installs via
pip
andrequirements.txt
, but I am using poetry) - https://github.com/abatilo/actions-poetry
(this action, can install poetry, but using
pip
, which is not recommended by poetry, as it can cause conflict with my application dependencies, see issue ) - https://github.com/ymyzk/tox-gh-actions (should I use this ? why not rather run
pytest
in every matrix (of github actions), this action seems to defeat the purpose of tox)
I want to test my python code in gh-actions.
in my situation, what should I actually use ?
what are the best practices ? and most optimum tool
...ANSWER
Answered 2021-Apr-14 at 12:11The beauty of tox
is that you can run it both locally and on CI.
You have a high chance of a successful CI when it passes locally, and also you only need to define the test requirements and the test setup once, in one file.
To do so, I recommend using the mentioned tox-gh-actions
.
I applied this pattern to dozens of repositories with success.
I recommend the following blog post which gives a great introduction to this setup:
https://hynek.me/articles/python-github-actions/
You can have a look at the tox.ini and the gh action config file for e.g. Flask-Reuploaded.
As to your question about running pytest in every matrix... the drawback here is that you need to take care of the test setup yourself, and you have to define everything at two places, tox.ini
for local testing and in the yaml config for gh actions.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tox-gh-actions
You can use tox-gh-actions like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page