Skip to content

Include Adyen packages recursively#223

Merged
antolo-arch merged 1 commit into
Adyen:developfrom
allburov:develop
Mar 10, 2023
Merged

Include Adyen packages recursively#223
antolo-arch merged 1 commit into
Adyen:developfrom
allburov:develop

Conversation

@allburov

@allburov allburov commented Mar 10, 2023

Copy link
Copy Markdown
Contributor

Description
Right now if we try to install the library from develop branch it gives a error

ModuleNotFoundError: No module named 'Adyen.services'

It happens because the services module is used to be file and now it has been split to a module and the setuptools don't include all modules recursively, so we have to "find modules" this way.

Tested scenarios

# install the library
git clone https://github.com/Adyen/adyen-python-api-library.git
cd adyen-python-api-library
python ./setup.py

# try to import and use it
echo "import Adyen" > test.py
python test.py
>>> ModuleNotFoundError: No module named 'Adyen.services'

@allburov allburov requested a review from a team March 10, 2023 09:34
@antolo-arch

Copy link
Copy Markdown
Contributor

Hi @allburov, could you please try to run
python ./setup.py install
as this should properly install the package, and let you experiment with our develop branch.

@allburov

Copy link
Copy Markdown
Contributor Author

@antolo-arch good suggestion, but we want to use it in the project requirements.txt, because I'd like to use a few unreleased features (even if they contain bugs, it's fine for us, we're going to test it properly before).
pip install (or poetry install) in my case works with build, not install.

I think it's kinda like a good practice for python projects - be able to be installed from git via pip install git+https://github.com/...

@allburov

Copy link
Copy Markdown
Contributor Author

@antolo-arch
Sorry for confusing, I got that I haven't highlighted it in the description.

This is the case:

# Install
poetry add git+https://github.com/allburov/adyen-python-api-library.git#develop
poetry install

# try to import and use it
echo "import Adyen" > test.py
python test.py
>>> ModuleNotFoundError: No module named 'Adyen.services'

Also without the change you'll encounter problems with publishing the package to pypi - in the current state I believe it won't contain services directory

@antolo-arch antolo-arch reopened this Mar 10, 2023
@antolo-arch

Copy link
Copy Markdown
Contributor

Hey @allburov,
I see, you're right, the service directory was missing indeed. Thanks for the contribution! 🚀

@antolo-arch antolo-arch merged commit 2c7dc28 into Adyen:develop Mar 10, 2023
@allburov

Copy link
Copy Markdown
Contributor Author

@antolo-arch thank you for such quick reaction! ❤️

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.

3 participants