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

Add debian packages setup #531

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/project_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ Example of `ecosystem.json`:
"extra_dependencies": [
"pytest"
],
"debian_dependencies": [
"jq"
],
"language": {
"name": "python",
"versions": ["3.9"]
Expand Down
6 changes: 6 additions & 0 deletions ecosystem/models/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class RepositoryConfiguration(JsonSerializable):
ex: for python `requirements.txt`
extra_dependencies: list of extra dependencies for project to install during tests run
ex: for python it might be `qiskit==0.19`
debian_dependencies: list of debian dependenies for project to install during tests run
ex: jq
tests_command: list of commands to run tests
ex: for python `python -m unittest -v`
styles_check_command: list of commands to run style checks
Expand All @@ -77,6 +79,7 @@ class RepositoryConfiguration(JsonSerializable):
language: LanguageConfiguration = field(default_factory=PythonLanguageConfiguration)
dependencies_files: list[str] = new_list()
extra_dependencies: list[str] = new_list()
debian_dependencies: list[str] = new_list()
tests_command: list[str] = new_list()
styles_check_command: list[str] = new_list()
coverages_check_command: list[str] = new_list()
Expand All @@ -99,6 +102,7 @@ def from_dict(cls, dictionary: dict):
language=language,
dependencies_files=config.dependencies_files,
extra_dependencies=config.extra_dependencies,
debian_dependencies=config.debian_dependencies,
tests_command=config.tests_command,
styles_check_command=config.styles_check_command,
coverages_check_command=config.coverages_check_command,
Expand Down Expand Up @@ -126,6 +130,7 @@ def load(cls, path: str) -> "RepositoryConfiguration":
language=language,
dependencies_files=config.dependencies_files,
extra_dependencies=config.extra_dependencies,
debian_dependencies=config.debian_dependencies,
tests_command=config.tests_command,
styles_check_command=config.styles_check_command,
coverages_check_command=config.coverages_check_command,
Expand Down Expand Up @@ -168,6 +173,7 @@ def default(cls) -> "PythonRepositoryConfiguration":
language=PythonLanguageConfiguration(),
dependencies_files=["requirements.txt"],
extra_dependencies=["pytest", "coverage"],
debian_dependencies=["jq"],
tests_command=["pytest"], # -W error::DeprecationWarning
styles_check_command=["pylint -rn . tests"],
coverages_check_command=[
Expand Down
4 changes: 4 additions & 0 deletions ecosystem/templates/configured_tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
debian_deps =
{% for dep_debian in debian_dependencies -%}
{{ dep_debian|indent(7, True) }}
{% endfor -%}
deps = pytest
{% for dep_file in dependencies_files -%}
{{"-r"|indent(7, True)}} {{ dep_file }}
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ requests==2.31.0
coloredlogs==15.0.1
mdformat==0.7.10
toml==0.10.2
tox-DEBIAN==0.3
3 changes: 3 additions & 0 deletions tests/resources/configured_python_repository/ecosystem.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"extra_dependencies": [
"pytest"
],
"debian_dependencies": [
"jq"
],
"language": {
"name": "python",
"versions": ["3.6"]
Expand Down