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 script that checks dependency conflicts #218

Closed
wants to merge 1 commit into from

Conversation

oyvindeide
Copy link
Contributor

No description provided.

@oyvindeide oyvindeide self-assigned this Aug 18, 2021
@oyvindeide
Copy link
Contributor Author

Is this worth merging?

@jondequinor
Copy link
Contributor

jondequinor commented Aug 18, 2021

I think that it's not, since it's not considering the actual, built distribution. I think the easier and more correct approach would be to have a pip check integrated into the komodo build process. What do you think?

@jondequinor
Copy link
Contributor

In either case, added #219

@oyvindeide
Copy link
Contributor Author

I think that it's not, since it's not considering the actual, built distribution. I think the easier and more correct approach would be to have a pip check integrated into the komodo build process. What do you think?

I see your point, and having it at the end of the build process would make sense, but they are not exclusive. I see the use case of this more when bumping packages from pypi and needing to check dependencies. It will shorten the feedback loop significantly as opposed to having it as a part of the build process. It is of course not a fail safe, as some internal packages could have conflicting deps, but then we can at least find more of them earlier.

@jondequinor
Copy link
Contributor

Rename the script to "pypi_conflicts" or something, and add it to a pipeline so that you don't have to run it manually.

@oyvindeide
Copy link
Contributor Author

oyvindeide commented Aug 18, 2021

Rename the script to "pypi_conflicts" or something, and add it to a pipeline so that you don't have to run it manually.

The first part I agree on, the second also, but that would be up to the users of komodothough. This installs every package, and so is quite slow, running it on every (unchanged) release file would not make sense. The workflow would be on changes to a release file.

@oyvindeide
Copy link
Contributor Author

Something like this looks promising:
https://github.com/tj-actions/changed-files

@sondreso
Copy link
Contributor

sondreso commented Aug 18, 2021

The snyk job already does this 🙂

@sondreso
Copy link
Contributor

@oyvindeide
Copy link
Contributor Author

Did not think about that - can create something based on that

Comment on lines +57 to +62
parser.add_argument(
"--try-pip",
action="store_true",
help="If given, will try to install packages and check validity. Note that "
"creates a virtual environment and is quite slow",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need to pass --try-pip to actually have anything checked? What happens if this is not provided?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way, I think invoking this program like so

komodo-check-conflicts bleeding.yml repository.yml

should

  1. if it finds conflict, exit with a non-zero exit code and output these to stdout;
  2. if no conflict, exit with 0 without any output.

The parser is called "Checks if pypi packages are compatible" and the command is called "komodo-check-conflicts", so introducing "output", "requirements", and "try-pip" as default false is a bit unexpected.

Maybe remove --try-pip, rename --output-file to --generate-requirements. The latter should also

  1. have help text explaining that the program will "Output installed packages in pip requirements format.";
  2. not require a file, but generate the requirements on stdout. If the user needs something in a file, the unix philosophy warrants:

komodo-check-conflicts --generate-requirements > requirements.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you do, will remove that option so it always checks.

"install",
*requirements,
"--no-deps",
"--force-reinstall", # Probably not needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

@oysteoh
Copy link
Contributor

oysteoh commented Dec 22, 2021

Encourage to either

  • Make a comment justifying the PR to exist
  • Close it
  • Fix and merge

@oyvindeide
Copy link
Contributor Author

I will have a look at it in the next week or so, if I dont get anywhere I will close it.

@oyvindeide oyvindeide closed this Jan 4, 2022
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