-
Notifications
You must be signed in to change notification settings - Fork 560
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
fix: remove log message on import #1398
Conversation
Fixes RDFLib#839. Its not appropriate to print messages on import of a library.
@donbowman I agree with the sentiment of your change but I'm going to alter the PR to tidy tings a bit further! |
@donbowman how about this now? It still logs RDFlib version, but only in so-called 'interactive mode' when imported via terminal (line 102) |
I'm sure there has been more than one issue created about this in the past, and at least one other PR to address it. |
I thought I remembered a fix too... Oh well, addressed now. |
@ashleysommer just adding you to review in case I made a code boo boo. If @donbowman is happy with my changes and you approve, we can merge |
I don't agree. I don't want to see output to stdout from libraries, regardless of how I'm using this. E.g.. if I wrote a curses program this would wreck it. If you want debugging available, use the logger. But to print in a lib I don't think is good practice. |
OK, I've removed the logging of the version |
@donbowman The RDFLib project has been in constant and active development since 2001. It was originally written for Python 1.6.1, and in 2002 ported to Python 2.1. Back then, it was common for most python libraries to print their version to stdout when importing. It was actually considered best practice at that time. And while the rdflib code has been updated and tweaked to work on newer python versions over the last 20 years, a lot of the development practices in the codebase have not. One major reason for this, is because until fairly recently the rdflib codebase had been maintained by a small team consisting of remnants from the original developers, who still held onto the original development practices. Also important to note, the vast majority of contributors to RDFLib over the years are researchers, academics, ontologists, not software developers. We, the new maintainers are slowly trying to fix issues like this as they pop up, but we need to be mindful of not changing too much too quickly. A lot of people have been using rdflib for 20 years, and expect it to operate in a specific way. For example, there is likely more than one textbook used in universities around the world which includes something like "type Having said that, I agree this is a good change, and should be removed before releasing the next version (actually probably should have been removed for v6.0.0, which included several other similar breaking changes). |
Fixes #839.
Its not appropriate to print messages on import
of a library.
Fixes #
Proposed Changes