universities
universities copied to clipboard
Suggest to loosen the dependency on databases
Hi, your project universities requires "databases==0.3.2" in its dependency. After analyzing the source code, we found that some other versions of databases can also be suitable without affecting your project, i.e., databases 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.0, 0.3.1. Therefore, we suggest to loosen the dependency on databases from "databases==0.3.2" to "databases>=0.2.2,<=0.3.2" to avoid any possible conflict for importing more packages or for downstream projects that may use universities.
May I pull a request to loosen the dependency on databases?
By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?
For your reference, here are details in our analysis.
Your project universities(commit id: 8d77973ea5e5d6e077329b29ffdb798ab6c1f9ff) directly uses 1 APIs from package databases.
databases.core.Database.__init__
From which, 6 functions are then indirectly called, including 3 databases's internal APIs and 3 outsider APIs, as follows (neglecting some repeated function occurrences).
[/ycd/universities]
+--databases.core.Database.__init__
| +--databases.core.DatabaseURL.__init__
| +--databases.importer.import_from_string
| | +--databases.importer.ImportFromStringError.__init__
| | +--importlib.import_module
| +--aiocontextvars.ContextVar
| +--contextvars.ContextVar
We scan databases's versions among [0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.0, 0.3.1] and 0.3.2, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).
diff: 0.3.2(original) 0.2.2
['databases.backends.postgres.Record.__iter__', 'databases.backends.aiopg.AiopgConnection.transaction', 'databases.core.DatabaseURL.scheme', 'databases.backends.postgres.PostgresBackend._get_dialect', 'databases.core.DatabaseURL.database', 'databases.backends.aiopg.AiopgTransaction.rollback', 'databases.backends.aiopg.AiopgConnection', 'databases.backends.aiopg.AiopgTransaction', 'databases.core.DatabaseURL.replace', 'databases.core.Connection', 'databases.backends.aiopg.AiopgBackend.connect', 'databases.core.Database.force_rollback', 'databases.core.DatabaseURL.__repr__', 'databases.core.Database.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_all', 'databases.backends.aiopg.AiopgConnection._compile', 'databases.backends.aiopg.CompilationContext.__init__', 'databases.core.Connection.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_one', 'databases.backends.aiopg.AiopgConnection.__init__', 'databases.backends.aiopg.CompilationContext', 'databases.backends.postgres.PostgresConnection._compile', 'databases.backends.sqlite.SQLiteConnection', 'databases.backends.aiopg.AiopgConnection.release', 'databases.backends.postgres.PostgresConnection', 'databases.backends.sqlite.SQLiteBackend', 'databases.backends.postgres.Record.__len__', 'databases.core.Connection.__init__', 'databases.backends.aiopg.AiopgBackend', 'databases.core.DatabaseURL', 'databases.backends.aiopg.AiopgBackend.__init__', 'databases.backends.aiopg.AiopgTransaction.__init__', 'databases.backends.aiopg.AiopgBackend._get_connection_kwargs', 'databases.backends.aiopg.AiopgBackend.disconnect', 'databases.core.Database', 'databases.backends.aiopg.AiopgConnection.execute_many', 'databases.backends.postgres.Record.values', 'databases.backends.aiopg.AiopgConnection.execute', 'databases.core.Transaction', 'databases.backends.aiopg.AiopgConnection.iterate', 'databases.backends.aiopg.AiopgTransaction.start', 'databases.core.DatabaseURL.obscure_password', 'databases.backends.aiopg.AiopgConnection.acquire', 'databases.core.Transaction.__init__', 'databases.backends.aiopg.AiopgConnection.raw_connection', 'databases.backends.aiopg.AiopgBackend._get_dialect', 'databases.backends.postgres.Record', 'databases.backends.aiopg.AiopgBackend.connection', 'databases.backends.mysql.MySQLConnection', 'databases.backends.aiopg.AiopgTransaction.commit', 'databases.backends.mysql.MySQLBackend', 'databases.backends.postgres.PostgresBackend']
diff: 0.3.2(original) 0.2.3
['databases.backends.postgres.Record.__iter__', 'databases.backends.aiopg.AiopgConnection.transaction', 'databases.core.DatabaseURL.scheme', 'databases.core.DatabaseURL.database', 'databases.backends.aiopg.AiopgTransaction.rollback', 'databases.backends.aiopg.AiopgConnection', 'databases.backends.aiopg.AiopgTransaction', 'databases.core.DatabaseURL.replace', 'databases.core.Connection', 'databases.backends.aiopg.AiopgBackend.connect', 'databases.core.Database.force_rollback', 'databases.core.DatabaseURL.__repr__', 'databases.core.Database.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_all', 'databases.backends.aiopg.AiopgConnection._compile', 'databases.backends.aiopg.CompilationContext.__init__', 'databases.core.Connection.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_one', 'databases.backends.aiopg.AiopgConnection.__init__', 'databases.backends.aiopg.CompilationContext', 'databases.backends.postgres.PostgresConnection._compile', 'databases.backends.sqlite.SQLiteConnection', 'databases.backends.aiopg.AiopgConnection.release', 'databases.backends.postgres.PostgresConnection', 'databases.backends.postgres.Record.__len__', 'databases.backends.aiopg.AiopgBackend', 'databases.core.DatabaseURL', 'databases.backends.aiopg.AiopgBackend.__init__', 'databases.backends.aiopg.AiopgTransaction.__init__', 'databases.backends.aiopg.AiopgBackend._get_connection_kwargs', 'databases.backends.aiopg.AiopgBackend.disconnect', 'databases.core.Database', 'databases.backends.aiopg.AiopgConnection.execute_many', 'databases.backends.postgres.Record.values', 'databases.backends.aiopg.AiopgConnection.execute', 'databases.core.Transaction', 'databases.backends.aiopg.AiopgConnection.iterate', 'databases.backends.aiopg.AiopgTransaction.start', 'databases.core.DatabaseURL.obscure_password', 'databases.backends.aiopg.AiopgConnection.acquire', 'databases.core.Transaction.__init__', 'databases.backends.aiopg.AiopgConnection.raw_connection', 'databases.backends.aiopg.AiopgBackend._get_dialect', 'databases.backends.postgres.Record', 'databases.backends.aiopg.AiopgBackend.connection', 'databases.backends.mysql.MySQLConnection', 'databases.backends.aiopg.AiopgTransaction.commit']
diff: 0.3.2(original) 0.2.4
['databases.backends.postgres.Record.__iter__', 'databases.backends.aiopg.AiopgConnection.transaction', 'databases.core.DatabaseURL.scheme', 'databases.backends.aiopg.AiopgTransaction.rollback', 'databases.backends.aiopg.AiopgConnection', 'databases.backends.aiopg.AiopgTransaction', 'databases.core.DatabaseURL.replace', 'databases.core.Connection', 'databases.backends.aiopg.AiopgBackend.connect', 'databases.core.Database.force_rollback', 'databases.core.DatabaseURL.__repr__', 'databases.core.Database.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_all', 'databases.backends.aiopg.AiopgConnection._compile', 'databases.backends.aiopg.CompilationContext.__init__', 'databases.core.Connection.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_one', 'databases.backends.aiopg.AiopgConnection.__init__', 'databases.backends.aiopg.CompilationContext', 'databases.backends.postgres.PostgresConnection._compile', 'databases.backends.sqlite.SQLiteConnection', 'databases.backends.aiopg.AiopgConnection.release', 'databases.backends.postgres.PostgresConnection', 'databases.backends.postgres.Record.__len__', 'databases.backends.aiopg.AiopgBackend', 'databases.core.DatabaseURL', 'databases.backends.aiopg.AiopgBackend.__init__', 'databases.backends.aiopg.AiopgTransaction.__init__', 'databases.backends.aiopg.AiopgBackend._get_connection_kwargs', 'databases.backends.aiopg.AiopgBackend.disconnect', 'databases.core.Database', 'databases.backends.aiopg.AiopgConnection.execute_many', 'databases.backends.postgres.Record.values', 'databases.backends.aiopg.AiopgConnection.execute', 'databases.core.Transaction', 'databases.backends.aiopg.AiopgConnection.iterate', 'databases.backends.aiopg.AiopgTransaction.start', 'databases.core.DatabaseURL.obscure_password', 'databases.backends.aiopg.AiopgConnection.acquire', 'databases.core.Transaction.__init__', 'databases.backends.aiopg.AiopgConnection.raw_connection', 'databases.backends.aiopg.AiopgBackend._get_dialect', 'databases.backends.postgres.Record', 'databases.backends.aiopg.AiopgBackend.connection', 'databases.backends.mysql.MySQLConnection', 'databases.backends.aiopg.AiopgTransaction.commit']
diff: 0.3.2(original) 0.2.5
['databases.core.DatabaseURL.scheme', 'databases.backends.aiopg.AiopgConnection.transaction', 'databases.backends.aiopg.AiopgTransaction.rollback', 'databases.backends.aiopg.AiopgConnection', 'databases.backends.aiopg.AiopgTransaction', 'databases.core.DatabaseURL.replace', 'databases.core.Connection', 'databases.backends.aiopg.AiopgBackend.connect', 'databases.core.Database.force_rollback', 'databases.core.DatabaseURL.__repr__', 'databases.core.Database.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_all', 'databases.backends.aiopg.AiopgConnection._compile', 'databases.backends.aiopg.CompilationContext.__init__', 'databases.core.Connection.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_one', 'databases.backends.aiopg.AiopgConnection.__init__', 'databases.backends.aiopg.CompilationContext', 'databases.backends.postgres.PostgresConnection._compile', 'databases.backends.sqlite.SQLiteConnection', 'databases.backends.aiopg.AiopgConnection.release', 'databases.backends.postgres.PostgresConnection', 'databases.backends.aiopg.AiopgBackend', 'databases.core.DatabaseURL', 'databases.backends.aiopg.AiopgBackend.__init__', 'databases.backends.aiopg.AiopgTransaction.__init__', 'databases.backends.aiopg.AiopgBackend._get_connection_kwargs', 'databases.backends.aiopg.AiopgBackend.disconnect', 'databases.core.Database', 'databases.backends.aiopg.AiopgConnection.execute_many', 'databases.backends.postgres.Record.values', 'databases.backends.aiopg.AiopgConnection.execute', 'databases.core.Transaction', 'databases.backends.aiopg.AiopgConnection.iterate', 'databases.backends.aiopg.AiopgTransaction.start', 'databases.core.DatabaseURL.obscure_password', 'databases.backends.aiopg.AiopgConnection.acquire', 'databases.core.Transaction.__init__', 'databases.backends.aiopg.AiopgConnection.raw_connection', 'databases.backends.aiopg.AiopgBackend._get_dialect', 'databases.backends.postgres.Record', 'databases.backends.aiopg.AiopgBackend.connection', 'databases.backends.mysql.MySQLConnection', 'databases.backends.aiopg.AiopgTransaction.commit']
diff: 0.3.2(original) 0.2.6
['databases.core.DatabaseURL.scheme', 'databases.backends.aiopg.AiopgConnection.transaction', 'databases.backends.aiopg.AiopgTransaction.rollback', 'databases.backends.aiopg.AiopgConnection', 'databases.backends.aiopg.AiopgTransaction', 'databases.core.DatabaseURL.replace', 'databases.core.Connection', 'databases.backends.aiopg.AiopgBackend.connect', 'databases.core.Database.force_rollback', 'databases.core.Database.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_all', 'databases.backends.aiopg.AiopgConnection._compile', 'databases.backends.aiopg.CompilationContext.__init__', 'databases.core.Connection.transaction', 'databases.backends.aiopg.AiopgConnection.fetch_one', 'databases.backends.aiopg.AiopgConnection.__init__', 'databases.backends.aiopg.CompilationContext', 'databases.backends.sqlite.SQLiteConnection', 'databases.backends.aiopg.AiopgConnection.release', 'databases.backends.aiopg.AiopgBackend', 'databases.core.DatabaseURL', 'databases.backends.aiopg.AiopgBackend.__init__', 'databases.backends.aiopg.AiopgTransaction.__init__', 'databases.backends.aiopg.AiopgBackend._get_connection_kwargs', 'databases.backends.aiopg.AiopgBackend.disconnect', 'databases.core.Database', 'databases.backends.aiopg.AiopgConnection.execute_many', 'databases.backends.postgres.Record.values', 'databases.backends.aiopg.AiopgConnection.execute', 'databases.core.Transaction', 'databases.backends.aiopg.AiopgConnection.iterate', 'databases.backends.aiopg.AiopgTransaction.start', 'databases.backends.aiopg.AiopgConnection.acquire', 'databases.core.Transaction.__init__', 'databases.backends.aiopg.AiopgConnection.raw_connection', 'databases.backends.aiopg.AiopgBackend._get_dialect', 'databases.backends.postgres.Record', 'databases.backends.aiopg.AiopgBackend.connection', 'databases.backends.mysql.MySQLConnection', 'databases.backends.aiopg.AiopgTransaction.commit']
diff: 0.3.2(original) 0.3.0
['databases.backends.postgres.Record.values', 'databases.core.Transaction', 'databases.core.Database.transaction', 'databases.core.Transaction.__init__', 'databases.core.DatabaseURL', 'databases.backends.postgres.Record', 'databases.core.Connection.transaction', 'databases.core.Database', 'databases.core.DatabaseURL.replace', 'databases.core.Connection']
diff: 0.3.2(original) 0.3.1
['databases.backends.postgres.Record.values', 'databases.core.DatabaseURL', 'databases.backends.postgres.Record', 'databases.core.DatabaseURL.replace', 'databases.core.Connection']
As for other packages, the APIs of @outside_package_name are called by databases in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.
Therefore, we believe that it is quite safe to loose your dependency on databases from "databases==0.3.2" to "databases>=0.2.2,<=0.3.2". This will improve the applicability of universities and reduce the possibility of any further dependency conflict with other projects/packages.