Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#24173 closed defect (not a bug)

nyx-2.0.4: setup.py doesn't list sqlite3 as a dependency

Reported by: yurivict271 Owned by:
Priority: Medium Milestone:
Component: Archived/Nyx Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

setup.py currently has: install_requires = ['stem>=1.6.0']
However, it also depends on py-sqlite: __init__.py: import sqlite3
Anything else?

Child Tickets

Change History (17)

comment:1 Changed 3 years ago by yurivict271

Resolution: not a bug
Status: newclosed

comment:2 Changed 3 years ago by yurivict271

Resolution: not a bug
Status: closedreopened
Summary: nyx-2.0.4: setup.py doesn't list all dependenciesnyx-2.0.4: setup.py doesn't list sqlite3 as a dependency

It fails without py-sqlite3 on the FreeBSD.

comment:3 Changed 3 years ago by arma

Component: - Select a componentCore Tor/Nyx

comment:4 Changed 3 years ago by atagar

Thanks yurivict271. Sqlite is a python built-in as of python 2.5...

https://docs.python.org/2/library/sqlite3.html

Nyx provides messages for FreeBSD and Gentoo when it's unavailable. However, I'm a little unsure if we should take a setup.py dependency on pysqlite or not since this will cause us to install it on platforms that *do* include the builtin.

I'll check with Carlo (our FreeBSD maintainer) to see how he'd care to handle this.

comment:5 Changed 3 years ago by yurivict271

I'll check with Carlo (our FreeBSD maintainer) to see how he'd care to handle this.

I talked to Carlo, he said that it didn't work without installing the py-sqlite3 port.

comment:6 Changed 3 years ago by atagar

Oh. Actually, on reflection the FreeBSD port *does* already include a runtime dependency on py-sqlite3...

https://www.freshports.org/security/nyx/

Wouldn't a setup.py clause be redundant?

comment:7 Changed 3 years ago by yurivict271

Wouldn't a setup.py clause be redundant?

setup.py needs to list all needed dependencies. If it's required, it should be in setup.py. It looks like it is required,.

comment:8 Changed 3 years ago by atagar

Again, the trouble is that pip does not account for builtins. It only knows about pip managed packages. Here on Ubuntu (and most platforms) sqlite3 is built in, yet if I run 'pip install pysqlite' it still attempts to install it and I'm unsure if that's safe.

If you'd like we could try a conditional dependency...

'dependencies = ['stem'] if SQLITE_AVAILABLE else ['stem', 'pysqlite']

But quick look around seems to indicate there be dragons...

https://hynek.me/articles/conditional-python-dependencies/

comment:9 Changed 3 years ago by yurivict271

It also should be investigated why is the separate pysqlie3 needed on FreeBSD when docs say that it should be embedded.

comment:10 Changed 3 years ago by atagar

Gentoo lacks sqlite3 by default too. Iirc modules such as bz2 and sqlite are optional when python is compiled. Not sure why some platforms exclude it though. It certainly makes distribution annoying. :/

comment:11 Changed 3 years ago by yurivict271

I will ask in the FreeBSD's ML about the intentionality of this.

comment:12 Changed 3 years ago by yurivict271

On FreeBSD it looks like only python2 has this problem. So you need this if SQLITE_AVAILABLE else clause.

comment:13 Changed 3 years ago by atagar

Uggg, just gave this a try but by default pysqlite installation fails with...

In file included from src/module.c:24:0:
src/connection.h:33:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Installing pysqlite requires other packages, for instance on Ubuntu...

sudo apt-get install sqlite3 libsqlite3-dev

https://stackoverflow.com/questions/32083494/error-installing-python-pyzipcode

This is actually a crappier error output than what we presently have (allow users to install, but then give an OS specific message on how to install sqlite3).

How would you care to proceed?

comment:14 in reply to:  13 Changed 3 years ago by yurivict271

Replying to atagar:

Uggg, just gave this a try but by default pysqlite installation fails with...

How would you care to proceed?

Another way is to request to fix sqlite3 in python packages that are missing it. This is actually the right way. I was just hoping that it's easier to fix setup.py.

I would just file bug reports to offending parties, and not do anything in nyx itself.

comment:15 Changed 3 years ago by atagar

Resolution: not a bug
Status: reopenedclosed

Thanks yurivict271. Agreed with the caveat that I'm gonna leave the Gentoo and FreeBSD discussion to folks on those platforms. I'm delighted to take patches to make life better for those platforms (as we did with the custom Gentoo/FreeBSD messaging for this) but I don't have the bandwidth to lead the charge on fixing their python packages.

comment:16 in reply to:  15 Changed 3 years ago by yurivict271

Replying to atagar:

Thanks yurivict271. Agreed with the caveat that I'm gonna leave the Gentoo and FreeBSD discussion to folks on those platforms. I'm delighted to take patches to make life better for those platforms (as we did with the custom Gentoo/FreeBSD messaging for this) but I don't have the bandwidth to lead the charge on fixing their python packages.

This is totally reasonable, thank you for your help!

Cheers!
Yuri

comment:17 Changed 3 years ago by atagar

My pleasure, thanks for brainstorming this with us!

Note: See TracTickets for help on using tickets.