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

Introduce a shared pattern for python test libraries #228

Open
AlanCoding opened this issue May 27, 2021 · 1 comment
Open

Introduce a shared pattern for python test libraries #228

AlanCoding opened this issue May 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@AlanCoding
Copy link
Member

Lots of collections have pip requirements that are needed for testing but not for use. Probably most of them.

Right now we maintain the exclude list:

EXCLUDE_REQUIREMENTS = frozenset((
# obviously already satisfied or unwanted
'ansible', 'ansible-base', 'python', 'ansible-core',
# general python test requirements
'tox', 'pycodestyle', 'yamllint', 'pylint',
'flake8', 'pytest', 'pytest-xdist', 'coverage', 'mock',
# test requirements highly specific to Ansible testing
'ansible-lint', 'molecule', 'galaxy-importer', 'voluptuous',
# already present in image for py3 environments
'yaml', 'pyyaml', 'json',
))

A better way to configure this would be to allow the collection to specify a separate requirements file for test requirements.

Someone might also be interested in an ansible-builder option to produce an EE that includes test requirements. We would need to separate our exclude list into "always exclude" and "exclude for non-test".

Ping @thedoubl3j

Very much related to #210, and we should think through a pattern that applies equally to both these topics.

@AlanCoding AlanCoding added the enhancement New feature or request label May 27, 2021
@AlanCoding
Copy link
Member Author

If we have a "default" location of build-requirements.txt top-level in a collection, then test-requirements.txt seems like the obvious place for test requirements. Of course, we would need a way to give a special location with the meta/ EE metadata for collections.

Some versions of this pattern have already occurred in collections.

@samdoran samdoran added needs_triage New item that needs to be triaged and removed needs_triage New item that needs to be triaged labels Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants