Lightning-AI / Lightning-AI/pytorch-lightning
test rule in Makefile not working
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
## 🐛 Bug
```make test``` throw an error when running command: ```python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v```
Makefile test rule failing:
```Makefile
test: clean
# Review the CONTRIBUTING documentation for other ways to test.
pip install -e . -r requirements/pytorch/devel.txt
pip install -r requirements/pytorch/strategies.txt
# run tests with coverage
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v # Failing command
python -m coverage report
```
Error:
```
========================================= test session starts ==========================================
platform linux -- Python 3.8.3, pytest-7.1.2, pluggy-1.0.0 -- /home/cyprien/anaconda3/envs/lightning383/bin/python
cachedir: .pytest_cache
rootdir: /home/cyprien/Documents/github/lightning, configfile: setup.cfg
plugins: asyncio-0.18.3, forked-1.4.0, rerunfailures-10.2, hydra-core-1.2.0, cov-3.0.0, anyio-3.6.1
asyncio: mode=legacy
collected 0 items
========================================= 16 warnings in 0.01s =========================================
ERROR: file or directory not found: pytorch_lightning
make: *** [Makefile:34: test] Error 4
```
### To Reproduce
To reproduce, follow the Readme.md in ```tests/``` folder:
```bash
# clone the repo
git clone https://github.com/Lightning-AI/lightning.git # Updated link
cd lightning
# install required depedencies
python -m pip install ".[dev, examples]"
# Old versions compatibility
bash .actions/pull_legacy_checkpoints.sh
# Run test rule
make test # -> Failing
```
### Expected behavior
The test should start to run as it happens with this command
```python -m coverage run --source pytorch_lightning -m pytest src/pytorch_lightning ./tests/tests_pytorch -v```
This is command is the same one as in the Makefile but with ```src/pytorch_lightning``` instead of ```pytorch_lightning``` and ```./tests/tests_pytorch``` instead of ```./tests/```
### Environment
```
* CUDA:
- GPU:
- NVIDIA GeForce RTX 2060
- available: True
- version: 10.2
* Packages:
- numpy: 1.23.0
- pyTorch_debug: False
- pyTorch_version: 1.11.0+cu102
- pytorch-lightning: 1.7.0dev
- tqdm: 4.63.0
* System:
- OS: Linux
- architecture:
- 64bit
- ELF
- processor: x86_64
- python: 3.8.3
- version: #43-Ubuntu SMP Wed Jun 15 12:54:21 UTC 2022
```
### Additional context
If this not an error from me misusing it, I can create the pull request to fix it.
cc @carmocca @akihironitta @borda
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the test rule in Makefile and the testing instructions in tests/README.md. Compare the paths used by the failing pytest command with the working command described in the issue. Done means the Makefile test rule locates the source and test directories and begins the test run successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100