OoriData / OgbujiPT

Client-side toolkit for using large language models, including where self-hosted
Apache License 2.0
101 stars 8 forks source link

pip upgrade failed for 0.4.0 #37

Closed chimezie closed 1 year ago

chimezie commented 1 year ago

While attempting to update to 0.4.0 via the command below, I ran into an error.

$ pip install -U --no-cache-dir ogbujipt

The error was:

Requirement already satisfied: ogbujipt in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (0.3.2)
Collecting ogbujipt
  Downloading ogbujipt-0.4.0.tar.gz (47 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47.6/47.6 kB 491.6 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-kmye2n0e/overlay/lib/python3.10/site-packages/hatchling/build.py", line 56, in build_wheel
          return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
        File "/tmp/pip-build-env-kmye2n0e/overlay/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py", line 93, in build
          self.metadata.validate_fields()
        File "/tmp/pip-build-env-kmye2n0e/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 243, in validate_fields
          _ = self.version
        File "/tmp/pip-build-env-kmye2n0e/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 128, in version
          self._version = self._get_version()
        File "/tmp/pip-build-env-kmye2n0e/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 226, in _get_version
          version = self.hatch.version.cached
        File "/tmp/pip-build-env-kmye2n0e/overlay/lib/python3.10/site-packages/hatchling/metadata/core.py", line 1415, in cached
          raise type(e)(message) from None
      OSError: Error getting the version from source `regex`: file does not exist: pylib/__about__.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

However, I was able to successfully install it from the latest in Git main:

$ pip install -U  --no-cache-dir .
Processing /home/chimezie/Projects/Oori/OgbujiPT
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: openai in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from OgbujiPT==0.4.0) (0.27.8)
Requirement already satisfied: python-dotenv in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from OgbujiPT==0.4.0) (1.0.0)
Collecting tomli (from OgbujiPT==0.4.0)
  Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Requirement already satisfied: requests>=2.20 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from openai->OgbujiPT==0.4.0) (2.31.0)
Requirement already satisfied: tqdm in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from openai->OgbujiPT==0.4.0) (4.66.0)
Requirement already satisfied: aiohttp in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from openai->OgbujiPT==0.4.0) (3.8.5)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from requests>=2.20->openai->OgbujiPT==0.4.0) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from requests>=2.20->openai->OgbujiPT==0.4.0) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from requests>=2.20->openai->OgbujiPT==0.4.0) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from requests>=2.20->openai->OgbujiPT==0.4.0) (2023.7.22)
Requirement already satisfied: attrs>=17.3.0 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from aiohttp->openai->OgbujiPT==0.4.0) (23.1.0)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from aiohttp->openai->OgbujiPT==0.4.0) (6.0.4)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from aiohttp->openai->OgbujiPT==0.4.0) (4.0.3)
Requirement already satisfied: yarl<2.0,>=1.0 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from aiohttp->openai->OgbujiPT==0.4.0) (1.9.2)
Requirement already satisfied: frozenlist>=1.1.1 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from aiohttp->openai->OgbujiPT==0.4.0) (1.4.0)
Requirement already satisfied: aiosignal>=1.1.2 in /home/chimezie/miniconda3/envs/OgbujiPT-py-3.10/lib/python3.10/site-packages (from aiohttp->openai->OgbujiPT==0.4.0) (1.3.1)
Building wheels for collected packages: OgbujiPT
  Building wheel for OgbujiPT (pyproject.toml) ... done
  Created wheel for OgbujiPT: filename=ogbujipt-0.4.0-py3-none-any.whl size=24497 sha256=f3a385f291744e3aea447032a8868bca1a55ab6df82e250e6803dc5e4aab9c40
  Stored in directory: /tmp/pip-ephem-wheel-cache-1bmvl7_8/wheels/fe/6a/c9/ecdc9de6abff39026de41acd703b5561c92a0d3ffc64ac8b92
Successfully built OgbujiPT
Installing collected packages: tomli, OgbujiPT
  Attempting uninstall: OgbujiPT
    Found existing installation: OgbujiPT 0.3.2
    Uninstalling OgbujiPT-0.3.2:
      Successfully uninstalled OgbujiPT-0.3.2
Successfully installed OgbujiPT-0.4.0 tomli-2.0.1
uogbuji commented 1 year ago

So this looks like using miniconda? I don't think we really test with that @kaischuygon do I remember you use it, too?

choccccy commented 1 year ago

I wonder if there's something wrong with how I packaged for pypi, this is my first release there. I thought I followed the guidelines here on the wiki

choccccy commented 1 year ago

Seems to have been fixed by building a wheel before uploading to PyPI