1

I have two parts with their own requirements.txt files. These files have some packages in common. When I run 'snapcraft' command, it complains - 'Parts one and two have the following file paths in common which have different contents'. How can I install both parts with their own requirement.txt in the same snap?

1

You can filter files out of the stage directory, like this:

parts: part1: [...] part2: [...] stage: - -file_that_conflicts_1 - -file_that_conflicts_2

Probably, you need to chose the files from one of the parts that will end up in the snap, and filter out the duplicates from the other part.

You can read more about limiting the number of installed files here: https://docs.snapcraft.io/build-snaps/advanced-features#limiting-the-number-of-installed-files

| improve this answer | |
  • 1
    These requirements.txt files are related to pip installs for python projects. I finally found a workaround by installing the pip packages at two different locations using --prefix option and adding these locations to pythonpath. This was not ideal. If snapcraft would install dependencies from first reqruiements.txt and then skip the common ones from second, it would have been fantastic. – wilson Nov 27 '17 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.