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

Import sqlite3 only if used; minor bugfixes #620

Merged
merged 1 commit into from
May 16, 2017

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented May 12, 2017

Still a single import, but this way it's only attempted if you're actually using a sqlite example database. IMO it is better to raise an import error if you attempt to use sqlite than to change the database selection logic depending on whether it is installed. Closes #173.

@Zac-HD Zac-HD force-pushed the conditional-sqlite branch from 10fb3e2 to a6f3243 Compare May 12, 2017 08:39
@Zac-HD Zac-HD force-pushed the conditional-sqlite branch from a6f3243 to 2f20f98 Compare May 12, 2017 10:11
@Zac-HD Zac-HD force-pushed the conditional-sqlite branch 2 times, most recently from 6329368 to 0f9081e Compare May 14, 2017 03:26
@Zac-HD Zac-HD changed the title Only import sqlite3 if it's about to be used Import sqlite3 only if used; minor bugfixes May 14, 2017
@Zac-HD Zac-HD requested review from alexwlchan and DRMacIver May 14, 2017 07:48
Copy link
Member

@DRMacIver DRMacIver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should resist the temptation to bundle multiple fixes into a single PR just so they go in a single release, so I'd like to split this out into two PRs with their own patch release.

The individual changes look fine, but I'd like some tests for them - I'm not at all clear on how we'd test the sqlite3 logic right now, so if we can't think of something then I'm happy to leave it, but the enum change should definitely be tested.

@Zac-HD
Copy link
Member Author

Zac-HD commented May 14, 2017

I think we should resist the temptation to bundle multiple fixes into a single PR just so they go in a single release, so I'd like to split this out into two PRs with their own patch release.

Sure. I just find it frustrating to write competing changelogs for a single proposed version - is there anything I can do to help review go faster?

@Zac-HD Zac-HD force-pushed the conditional-sqlite branch from 0f9081e to 3cc95a1 Compare May 14, 2017 12:13
@Zac-HD
Copy link
Member Author

Zac-HD commented May 14, 2017

Also unsure how to test this, but pulls have been split. Any other blockers?

Copy link
Member

@DRMacIver DRMacIver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just find it frustrating to write competing changelogs for a single proposed version

I agree. I think some means of automating changelog aggregation and version management is increasingly necessary. I'm still pondering what the best thing to do is here, but am very open to suggestions.

is there anything I can do to help review go faster?

I think not really - the major blocker on review is just that @alexwlchan and I are both quite busy on other things right now, and we're the main people who could review.

docs/changes.rst Outdated

Instead of unconditionally importing ``sqlite3``, Hypothesis now imports it
when a SQLite database is first used. This was the major blocker for BSD
support with default settings.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably just say "this allows Hypothesis to work on implementations compiled without sqlite support" or similar. It's not really a major blocker because the fix is just "install sqlite support".

@Zac-HD Zac-HD force-pushed the conditional-sqlite branch from 3cc95a1 to 573bc62 Compare May 15, 2017 03:34
docs/changes.rst Outdated

This is a compatibility release: Hypothesis no longer imports ``sqlite3``
before a SQLite database is first used, so the default settings now work on
Python implementations compiled without sqlite support (eg BSD).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refuse to make this a blocking comment and am going to approve the change, but my preferred convention here is "e.g. " rather than "eg" and it would make me happy if you followed. :-)

@DRMacIver
Copy link
Member

LGTM. Note that you'll need to rebase against master before it's mergeable.

@Zac-HD
Copy link
Member Author

Zac-HD commented May 15, 2017

And bump the date in the changelog!

@Zac-HD Zac-HD force-pushed the conditional-sqlite branch from 573bc62 to e67a5bb Compare May 15, 2017 12:26
@Zac-HD
Copy link
Member Author

Zac-HD commented May 15, 2017

@DRMacIver, after #629 is merged we can rerun the changelog check and merge.

Still a single import, but this way it's only attempted if you're
actually using a sqlite example database.
@Zac-HD Zac-HD force-pushed the conditional-sqlite branch from e67a5bb to 775084a Compare May 16, 2017 08:46
@Zac-HD Zac-HD merged commit 1625535 into HypothesisWorks:master May 16, 2017
@Zac-HD Zac-HD deleted the conditional-sqlite branch August 17, 2018 23:44
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

Successfully merging this pull request may close these issues.

2 participants