You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have a method/function in a file in repo A, and I'm trying to import it in a file in repo B. So at the top of the file in repo B, I have:
from repo_A.folder.folder.File_name import Method
And then I call the method. Will this work, or is there a better way to get it to work?
Python imports care about your directory structure. As long as the file is found in the given reference, the import will work.
The recommended approach is to keep your repo (or repos structure) aligned with the directory structure you need, so you can just clone/checkout once and build your project on any machine, including other developers' machines and CI machines.
If your repo_A is depended on repo_B, consider one of the following options:
1. Merge the repos into one.
2. Use git sub-module or sub-tree.
3. Include repo_B's artifact as a dependency in repo_A - download the binary from artifactory or other binary server. In this option the `import` will be a bit different.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.