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

Update README in encouraging the use of uv #39

Open
simonpanay opened this issue Nov 28, 2024 · 6 comments
Open

Update README in encouraging the use of uv #39

simonpanay opened this issue Nov 28, 2024 · 6 comments
Assignees

Comments

@simonpanay
Copy link

Install dependencies

uv venv --python 3.8
uv pip install -r requirements.txt

Run a10y

uv run a10y.py
@jschaeff
Copy link
Contributor

jschaeff commented Dec 9, 2024

Linked to #37

@NikolaosSokos NikolaosSokos mentioned this issue Jan 15, 2025
@jschaeff
Copy link
Contributor

Hi @NikolaosSokos ,

I have an issue when installing with uv.
Are you able to reproduce ?

$ uv --version         
uv 0.5.27 (73e9928d4 2025-02-03)
$ uv sync   --python 3.13     
Resolved 30 packages in 11ms
  × Failed to build `multidict==6.0.4`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stdout]
      *********************
      * Accelerated build *
      *********************
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-313/multidict
      copying multidict/__init__.py -> build/lib.linux-x86_64-cpython-313/multidict
      copying multidict/_abc.py -> build/lib.linux-x86_64-cpython-313/multidict
      copying multidict/_compat.py -> build/lib.linux-x86_64-cpython-313/multidict
      copying multidict/_multidict_base.py -> build/lib.linux-x86_64-cpython-313/multidict
      copying multidict/_multidict_py.py -> build/lib.linux-x86_64-cpython-313/multidict
      running egg_info
      writing multidict.egg-info/PKG-INFO
      writing dependency_links to multidict.egg-info/dependency_links.txt
      writing top-level names to multidict.egg-info/top_level.txt
      reading manifest file 'multidict.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'multidict.egg-info/SOURCES.txt'
      copying multidict/__init__.pyi -> build/lib.linux-x86_64-cpython-313/multidict
      copying multidict/py.typed -> build/lib.linux-x86_64-cpython-313/multidict
      running build_ext
      building 'multidict._multidict' extension
      creating build/temp.linux-x86_64-cpython-313/multidict
      clang -pthread -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -fPIC -fPIC -I/home/schaeffj/.cache/uv/builds-v0/.tmpjidd44/include -I/home/schaeffj/.local/share/uv/python/cpython-3.13.0-linux-x86_64-gnu/include/python3.13 -c
      multidict/_multidict.c -o build/temp.linux-x86_64-cpython-313/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing -pedantic

      [stderr]
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files found matching 'multidict/_multidict.html'
      warning: no previously-included files found matching 'multidict/*.so'
      warning: no previously-included files found matching 'multidict/*.pyd'
      warning: no previously-included files found matching 'multidict/*.pyd'
      no previously-included directories found matching 'docs/_build'
      /home/schaeffj/.cache/uv/builds-v0/.tmpjidd44/lib/python3.13/site-packages/setuptools/command/build_py.py:212: _Warning: Package 'multidict._multilib' is absent from the `packages` configuration.
      !!

              ********************************************************************************
              ############################
              # Package would be ignored #
              ############################
              Python recognizes 'multidict._multilib' as an importable package[^1],
              but it is absent from setuptools' `packages` configuration.

              This leads to an ambiguous overall configuration. If you want to distribute this
              package, please make sure that 'multidict._multilib' is explicitly added
              to the `packages` configuration field.

              Alternatively, you can also rely on setuptools' discovery methods
              (for example by using `find_namespace_packages(...)`/`find_namespace:`
              instead of `find_packages(...)`/`find:`).

              You can read more about "package discovery" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

              If you don't want 'multidict._multilib' to be distributed and are
              already explicitly excluding 'multidict._multilib' via
              `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
              you can try to use `exclude_package_data`, or `include-package-data=False` in
              combination with a more fine grained `package-data` configuration.

              You can read more about "package data files" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


              [^1]: For Python, any directory (with suitable naming) can be imported,
                    even if it does not contain any `.py` files.
                    On the other hand, currently there is no concept of package data
                    directory, all directories are treated like packages.
              ********************************************************************************

      !!
        check.warn(importable)
      In file included from multidict/_multidict.c:9:
      multidict/_multilib/iter.h:225:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        225 | multidict_iter_init()
            |                    ^
            |                     void
      In file included from multidict/_multidict.c:10:
      multidict/_multilib/views.h:388:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        388 | multidict_views_init()
            |                     ^
            |                      void
      multidict/_multidict.c:453:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        453 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:453:10: note: did you mean 'PyArg_ParseTupleAndKeywords'?
      /home/schaeffj/.local/share/uv/python/cpython-3.13.0-linux-x86_64-gnu/include/python3.13/modsupport.h:11:17: note: 'PyArg_ParseTupleAndKeywords' declared here
         11 | PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
            |                 ^
      multidict/_multidict.c:498:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        498 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:533:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        533 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:712:5: error: call to undeclared function 'Py_TRASHCAN_SAFE_BEGIN'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        712 |     Py_TRASHCAN_SAFE_BEGIN(self);
            |     ^
      multidict/_multidict.c:718:5: error: call to undeclared function 'Py_TRASHCAN_SAFE_END'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        718 |     Py_TRASHCAN_SAFE_END(self);
            |     ^
      multidict/_multidict.c:775:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        775 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:834:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        834 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:870:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        870 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:917:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        917 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:965:10: error: call to undeclared function '_PyArg_ParseStackAndKeywords'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        965 |     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
            |          ^
      multidict/_multidict.c:1684:18: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
       1684 | PyInit__multidict()
            |                  ^
            |                   void
      3 warnings and 10 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1

      hint: This usually indicates a problem with the package or the build environment.
  help: `multidict` (v6.0.4) was included because `a10y` (v0.0.1) depends on `multidict`

@NikolaosSokos
Copy link
Contributor

Hello, @jschaeff

Python 3.13 Compatibility Fix for A10y

  • Python 3.12 works without issues.
  • For Python 3.13, updating dependencies resolved the problem.
dependencies = [
    "aiohttp>=3.11.12",
    "aiosignal>=1.3.1",
    "async-timeout>=4.0.3",
    "attrs>=23.1.0",
    "certifi>=2023.11.17",
    "charset-normalizer>=3.3.2",
    "click>=8.1.7",
    "frozenlist>=1.5.0",
    "idna>=3.4",
    "importlib-metadata>=6.8.0",
    "linkify-it-py>=2.0.2",
    "markdown-it-py[linkify,plugins]>=3.0.0",
    "mdit-py-plugins>=0.4.0",
    "mdurl>=0.1.2",
    "msgpack>=1.1.0",
    "multidict>=6.0.4",
    "pygments>=2.17.2",
    "requests>=2.31.0",
    "rich>=13.7.0",
    "textual>=0.43.2",
    "textual-autocomplete>=2.1.0b0",
    "textual-dev>=1.2.1",
    "tomli>=2.0.1",
    "typing-extensions>=4.12.0",
    "uc-micro-py>=1.0.2",
    "urllib3>=2.1.0",
    "yarl>=1.17.0",
    "zipp>=3.17.0",
]

This allows a10y to work on both Python 3.12 and 3.13.

I’m not entirely sure if having >= for all dependencies is the safest approach, but it seems to work for now. Let me know if there are any concerns!

@jschaeff
Copy link
Contributor

Yes, with this updated deps it works. I think you can commit this.

@NikolaosSokos
Copy link
Contributor

ok i merged this fix. I also added a PR for some issues I have fixed + app modularization.

@simonpanay
Copy link
Author

simonpanay commented Feb 11, 2025

I’m not entirely sure if having >= for all dependencies is the safest approach, but it seems to work for now. Let me know if there are any concerns!

Dependencies present in pyproject.toml are "just" metadata associated with the project.
If you need precise dependencies, one should use uv.lock file (or this method to generate a requirements.txt)

Thanks for fixing the dependencies issue

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