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 requirements files for python dependencies #10487

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

rhmdnd
Copy link
Collaborator

@rhmdnd rhmdnd commented Apr 24, 2023

This commit adds two separate requirements files that you can feed into
pip for installing python dependencies.

This makes it easier for contributors to install dependencies by having
them isolated to a couple specific files, instead of having to reference
build documentation.

@rhmdnd
Copy link
Collaborator Author

rhmdnd commented Apr 24, 2023

This overlaps with #10474 - but ideally at the end of the process all dependencies will either be in a bindep or requirements file.

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@matejak
Copy link
Member

matejak commented Apr 26, 2023

Would it be possible to use this in https://github.com/ComplianceAsCode/content/blob/master/.github/workflows/gate.yaml? i.e. to have the dnf-powered dep install stage followed by pip where it is applicable?

@evgenyz
Copy link
Member

evgenyz commented Apr 26, 2023

Would it be possible to use this in https://github.com/ComplianceAsCode/content/blob/master/.github/workflows/gate.yaml? i.e. to have the dnf-powered dep install stage followed by pip where it is applicable?

I'd just add that this stage could be optimized into dnf builddep foobar.spec where applicable. The apt-get manager on the other hand can only install specs from the version of the package in the repo AFAIK (so any new deps added during development cycle would cause troubles).

@rhmdnd
Copy link
Collaborator Author

rhmdnd commented Apr 26, 2023

Would it be possible to use this in https://github.com/ComplianceAsCode/content/blob/master/.github/workflows/gate.yaml? i.e. to have the dnf-powered dep install stage followed by pip where it is applicable?

You mean using the requirements.txt file during the python package install process?

diff --git a/.github/workflows/gate.yaml b/.github/workflows/gate.yaml
index ee43e6e2e4..0696d1bd46 100644
--- a/.github/workflows/gate.yaml
+++ b/.github/workflows/gate.yaml
@@ -60,7 +60,7 @@ jobs:
       - name: Install Deps
         run: apt-get install -y ansible-lint bats check cmake expat libopenscap8 libxml2-utils ninja-build python3-github python3-jinja2 python3-setuptools python3-pip python3-pytest python3-pytest-cov xsltproc
       - name: Install deps python
-        run: pip3 install ruamel.yaml yamlpath pyyaml==5.4.1
+        run: pip3 install -r requirements.txt
       - name: Checkout
         uses: actions/checkout@v2
       - name: Build

@openshift-merge-robot openshift-merge-robot added the needs-rebase Used by openshift-ci bot. label Apr 28, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Used by openshift-ci bot. label May 2, 2023
@rhmdnd rhmdnd requested a review from matejak May 2, 2023 21:16
@rhmdnd
Copy link
Collaborator Author

rhmdnd commented May 3, 2023

Looks like we have some issues where the workflows can't find the requirements files.

@matejak
Copy link
Member

matejak commented May 4, 2023

Looks like we have some issues where the workflows can't find the requirements files.

It may be that checking out the repo first and then to download deps (i.e. right before building the content) could help ;-)

requirements.txt Show resolved Hide resolved
@rhmdnd
Copy link
Collaborator Author

rhmdnd commented May 5, 2023

Looks like we have some issues where the workflows can't find the requirements files.

It may be that checking out the repo first and then to download deps (i.e. right before building the content) could help ;-)

After I looked a little closer I saw that checkout was happening right after the pip install step. Thanks!

@rhmdnd
Copy link
Collaborator Author

rhmdnd commented May 9, 2023

Rebasing to pull in #10540

@rhmdnd
Copy link
Collaborator Author

rhmdnd commented May 10, 2023

Clean CI run now that we're past the testing farm issue (for now).

Should be good for another round of reviews.

@rhmdnd rhmdnd requested a review from Mab879 May 10, 2023 13:52
@Mab879 Mab879 added this to the 0.1.68 milestone May 10, 2023
@Mab879 Mab879 added the Documentation Update in project documentation. label May 10, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Used by openshift-ci bot. label May 27, 2023
@jan-cerny jan-cerny modified the milestones: 0.1.68, 0.1.69 May 29, 2023
@jan-cerny
Copy link
Collaborator

@rhmdnd @Mab879 What are your plans?

@Mab879 Mab879 self-assigned this Jun 5, 2023
@Mab879
Copy link
Member

Mab879 commented Jun 5, 2023

@rhmdnd This looks good to me. Can you please rebase to fix the conflicts.

This commit adds two separate requirements files that you can feed into
pip for installing python dependencies.

This makes it easier for contributors to install dependencies by having
them isolated to a couple specific files, instead of having to reference
build documentation.
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Used by openshift-ci bot. label Jun 6, 2023
@codeclimate
Copy link

codeclimate bot commented Jun 6, 2023

Code Climate has analyzed commit e014370 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 52.8% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 merged commit dad8550 into ComplianceAsCode:master Jun 6, 2023
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Update in project documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants