MousaZeidBaker / aws-lambda-typing

Python type hints for AWS Lambda
MIT License
106 stars 19 forks source link

Test issues on master branch: seeking environment configuration guidance #90

Closed yukinobu closed 1 year ago

yukinobu commented 1 year ago

Thank you for the wonderful product.

I'm considering contributing in the future, but the tests do not pass for the master branch. Could you provide some additional information on the Getting started section of CONTRIBUTING.md?


Here's what I've tried:

To use the pure environment, boot Python 3.10 official docker image with the following command:

docker run -it --rm python:3.10 bash

Upon starting the bash prompt inside the container, I executed the following:

# install poetry
curl -sSL https://install.python-poetry.org | python3 -
alias poetry=/root/.local/bin/poetry
# git clone
git clone https://github.com/MousaZeidBaker/aws-lambda-typing.git
cd aws-lambda-typing/

# commands from CONTRIBUTING.md
poetry install --sync && poetry shell
pre-commit install --install-hooks --overwrite
pre-commit run --all-files
pytest tests

As a result of the final pytest, I received the following:

bash: pytest: command not found

It appears that pytest cannot be used. I suspected that the reason was the absence of pytest in pyproject.toml, so I added pytest to dev-dependencies section.

  [tool.poetry.dependencies]
  python = "^3.6"
+ pytest = "^7.0"
  typing-extensions = { version = "^4.1.1", python = "<3.8" }

After making the changes to pyproject.toml as mentioned above, I executed the following command.

alias poetry=/root/.local/bin/poetry
poetry lock && poetry install --sync
pytest tests

The test results were 1 failed, 51 passed, 1 error. As this is the master branch, I was expecting all tests to pass, but that wasn't the case.

I suspect there might be some issues with my environment setup. If there are any differences between my environment and those of the contributors, I would greatly appreciate it if you could let me know.


For your reference, I have attached the results of the final pytest: pytest_result.txt

MousaZeidBaker commented 1 year ago

Hi @yukinobu.

I'm glad you like the project and thanks for reporting an issue.

The "Run tests" section in Contributing.md is wrong. It should NOT be pytest tests, but instead

mypy src
mypy tests

as can be seen in the pipeline, see here. And mypy is already present in pyproject.toml . I'll update the documentation. Sorry for the confusion.

yukinobu commented 1 year ago

Hi @MousaZeidBaker,

In my environment as well, the tests with mypy were successful. Thank you.

When I tried modifying test data and classes arbitrarily, the tests no longer passed. It seems the tests are functioning correctly.

I'm grateful for your prompt response and your commitment to maintaining the documentation.