catalyst-team / catalyst

Accelerated deep learning R&D
https://catalyst-team.com
Apache License 2.0
3.3k stars 388 forks source link

.tar.gz on PyPI is missing the `requirements/` directory #1375

Closed YodaEmbedding closed 2 years ago

YodaEmbedding commented 2 years ago

🐛 Bug Report

.tar.gz on PyPI is missing the requirements/ directory.

How To Reproduce

Download latest .tar.gz from: https://pypi.org/project/catalyst/#files.

Code sample

wget https://files.pythonhosted.org/packages/92/6b/035a8394f8aabff4d1bf8eab6eb232b9b4e187f6b62564fcb94feaaf7a82/catalyst-21.11.tar.gz
tar xf catalyst-21.11.tar.gz
cd catalyst-21.11
pip install .

Error log:

Processing /mnt/data/Downloads/catalyst-21.11
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /nix/store/bqpbprsqhlvmkfp1nqqm677dqr7ymjpl-python3-3.9.6-env/bin/python3.9 /nix/store/bqpbprsqhlvmkfp1nqqm677dqr7ymjpl-python3-3.9.6-env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmp0a2ik0cl
       cwd: /tmp/pip-req-build-yge_hp0l
  Complete output (20 lines):
  Traceback (most recent call last):
    File "/nix/store/bqpbprsqhlvmkfp1nqqm677dqr7ymjpl-python3-3.9.6-env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
      main()
    File "/nix/store/bqpbprsqhlvmkfp1nqqm677dqr7ymjpl-python3-3.9.6-env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/nix/store/bqpbprsqhlvmkfp1nqqm677dqr7ymjpl-python3-3.9.6-env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-qb_mcgns/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/tmp/pip-build-env-qb_mcgns/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-qb_mcgns/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/tmp/pip-build-env-qb_mcgns/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 43, in <module>
      "albu": load_requirements("requirements/requirements-albu.txt"),
    File "setup.py", line 22, in load_requirements
      with open(os.path.join(PROJECT_ROOT, filename), "r") as f:
  FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-yge_hp0l/requirements/requirements-albu.txt'
  ----------------------------------------

Additional context

pip install should be sufficient to build the package. This makes it easier to package on systems like NixOS.

{ lib
, buildPythonPackage
, fetchPypi
, hydra-slayer
, numpy
, pytest
, pytorch
, pyyaml
, tensorboardx
, tqdm
}:

buildPythonPackage rec {
  pname = "catalyst";
  version = "21.11";

  src = fetchPypi {
    inherit pname version;
    sha256 = "";
  };

  propagatedBuildInputs = [
    hydra-slayer
    numpy
    pytorch
    pyyaml
    tensorboardx
    tqdm
  ];

  checkInputs = [
    pytest
  ];

  meta = with lib; {
    description = "Accelerated deep learning R&D";
    homepage = "https://github.com/catalyst-team/catalyst";
    maintainers = [ ];
  };
}
{ lib
, buildPythonPackage
, fetchPypi
, pytest
}:

buildPythonPackage rec {
  pname = "hydra-slayer";
  version = "0.4.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-Ln7wuZ5eEVBNgJlvaJ7V7Xrodm7bjna2kzswaWYVlgQ=";
  };

  checkInputs = [
    pytest
  ];

  meta = with lib; {
    description = "PyTorch library for configuring complex applications";
    homepage = "https://github.com/catalyst-team/hydra-slayer";
  };
}

EDIT: P.S. Consider bumping to tensorboardX<2.5.0>=2.1.0 if there's no breaking changes.

github-actions[bot] commented 2 years ago

Hi! Thank you for your contribution! Please re-check all issue template checklists - unfilled issues would be closed automatically. And do not forget to join our slack for collaboration.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.