googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

Relax dependency requirements #618

Closed bkmgit closed 2 years ago

bkmgit commented 2 years ago

The requirements.txt file gives only specific versions of dependencies. It would be helpful to allow for a range of versions of dependencies for more flexible installation and setup.

behdad commented 2 years ago

I agree. I've been bitten by pip being unable to resolve dependencies because of this.

anthrotype commented 2 years ago

the requirements.txt file is only used to set up the test environment, it uses pinned versions to make sure test runs are reproducible; it should be kept up-to-date periodically using the pyup.io bot to latest versions as they come up. The actual dependency versions that get installed when one does pip install ufo2ft (or indirectly installs ufo2ft as part of some other applications, e.g. fontmake) depend on what is available on PyPI at the moment one runs pip install, what is already installed in the environment where pip installs to, and whether those already satisfy or not the minimum required versions (>=) that are specified not in requirements.txt, but in ufo2ft's setup.py's install_requires parameter. Those are bounded only by the minimum version and aare not strictly pinned, for that would create problems when installing ufo2ft (a library) alongside other libraries that may require slightly different but compatible versions of the same dependencies. How do you install ufo2ft? When/how exactly you stumbled on dependency resolution errors? If I can repro, I may try to fix.

bkmgit commented 2 years ago

Thanks for the explanation. This is helpful when packaging for linux distributions which may have slightly different versions of the dependencies already packaged.

madig commented 2 years ago

There should be distro guidelines for Python packaging, the relevant dep specifiers for installation are declared in https://github.com/googlefonts/ufo2ft/blob/f5ebcd8ed567d67017dd37769468c8809dbf7c15/setup.py#L31-L41.

behdad commented 2 years ago

Or the test requirements file be renamed to test-requirements.txt ideally.

bkmgit commented 2 years ago

Maybe the tests or code could be updated so that they are not so fragile? If exact versions of the dependencies need to be fixed, rather than checking for breaking changes in the dependencies, this suggests fonts produced with other dependencies may be defective.