Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements.txt is missing in the pypi source tarball #429

Open
hubutui opened this issue Jun 16, 2023 · 6 comments
Open

requirements.txt is missing in the pypi source tarball #429

hubutui opened this issue Jun 16, 2023 · 6 comments

Comments

@hubutui
Copy link

hubutui commented Jun 16, 2023

requirements.txt is not included in the source tarball for release pypi grad-cam 1.4.7. This leads to building error:

* Getting build dependencies for wheel...
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
    self.run_setup()
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
    exec(code, locals())
  File "<string>", line 6, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

BTW, could you also add a release tag in the GitHub repo?

@jacobgil
Copy link
Owner

Thanks for reporting. This should be fixed now.

@jacobgil
Copy link
Owner

Will definitely look into a release tag, thanks for suggesting.

@ValMystletainn
Copy link

ValMystletainn commented Jun 16, 2023

I just made a fast fixing and make a PR #431 to you @jacobgil
Another suggestion maybe refactor the building and packing configuration? since there are pyproject.toml, setup.cfg, requirements.txt, MANIFEST.in(if my PR is accepted), too many files, how about refactoring and shrink into just pyproject.toml and requirement.txt

@jacobgil
Copy link
Owner

Great, thanks a lot.
A PR with pyproject.toml and requirements.txt would be a great contribution !
Will merge the 431 PR soon once the pipeline passes.

The 1.4.8 version published earlier today should be fixed already.

@hubutui
Copy link
Author

hubutui commented Jun 16, 2023

I got an assert error when running the check:

    @pytest.mark.parametrize("cam_method",
                             [GradCAM])
    def test_memory_usage_in_loop(numpy_image, batch_size, width, height,
                                  cnn_model, target_layer_names, cam_method,
                                  target_category, aug_smooth, eigen_smooth):
        img = cv2.resize(numpy_image, (width, height))
        input_tensor = preprocess_image(img)
        input_tensor = input_tensor.repeat(batch_size, 1, 1, 1)
        model = cnn_model(pretrained=True)
        target_layers = []
        for layer in target_layer_names:
            target_layers.append(eval(f"model.{layer}"))
        targets = [ClassifierOutputTarget(target_category)
                   for _ in range(batch_size)]
        initial_memory = 0
        for i in range(100):
            with cam_method(model=model,
                            target_layers=target_layers,
                            use_cuda=False) as cam:
                grayscale_cam = cam(input_tensor=input_tensor,
                                    targets=targets,
                                    aug_smooth=aug_smooth,
                                    eigen_smooth=eigen_smooth)
    
                if i == 0:
                    initial_memory = psutil.virtual_memory()[2]
>           assert(psutil.virtual_memory()[2] <= initial_memory * 1.05)
E           assert 43.5 <= (40.4 * 1.05)

tests/test_context_release.py:69: AssertionError

@ValMystletainn
Copy link

Great, thanks a lot. A PR with pyproject.toml and requirements.txt would be a great contribution ! Will merge the 431 PR soon once the pipeline passes.

The 1.4.8 version published earlier today should be fixed already.

Done. But need you to tag the version to support the auto tag and version sync in pypi and git tag(details in PR)

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

No branches or pull requests

3 participants