-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Issue629 #630
Merged
Merged
Issue629 #630
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Python already has a feature for finding the temp dir. Changed test helper to take advantage of it. * Still outstanding: Several hard-coded references to /tmp appear in the tests. * Liberation-Mono is not commonly installed on Windows, and even when it is, the font has a different name. Provide a fall-back for Windows fonts. (Considered the use of a 3rd party tool to help select, but seemed overkill.)
Building/finding binaries on Windows is non-trivial. Aallow some flexibility in the path levels. (I don't want to force existing users to upgrade, but new users should be allowed the later patches.)
Doesn't do anything yet. The work is done in the subclasses that need it. Also supports context manager, to allow close to be implicitly performed without being forgotten even if an exception occurs during processes.
Demonstrate good practice in the examples.
Especially for Windows.
…led. The work should be done in close(). Deleting can be left for the garbage collector.
Again, avoid depending on __del__. Add a context manager interface. Use it lower down.
Was concerned that lambda might include a reference to reader that wasn't cleaned up by close, so changed it over to an equivalent self.reader. Probably has no effect, but feels safer.
Note: It does NOT close all the subclips, because they may be used again (by the caller). It is the caller's job to clean them up. But clips created by this instance are closed by this instance.
test_resourcereleasedemo exercises the path where close is not called and demonstrates that there is a consistent problem on Windows. Even after this fix, it remains a problem that if you don't call close, moviepg will leak locked files and subprocesses. [Because the problem remains until the process ends, this is included in a separate test file.] test_resourcerelease demonstrates that when close() is called, the problem goes away.
* Without tests changes, many of these existing tests do not pass on Windows.
Helvetica wasn't recognised by ImageMagick. Changing to another arbitrary font that should be available on all Windows machines.
…sues." This reverts commit dc4a16a. I bundled too much into one commit. Reverting and reapplying as two separate commits for better history.
Removed as it was crashing on Windows, achieving nothing on Linux.
Due to failing import.
* Add key support for close() * FFMPEG_VideoWriter and FFMPEG_AudioWriter: Support close() and context managers. * Clip: support close() and context manager. Doesn't do anything itself. The work is done in the subclasses that need it. * Clip subclasses: Overrride close. * Move away from depending on clients calling__del__(). Deleting can be left to Garbage Collector. * CompositeVideoClip: Note: Don't close anything that wasn't constructed here. The client needs to be able to control the component clips. * AudioFileClip: Was concerned that lambda might include a reference to reader that wasn't cleaned up by close, so changed it over to an equivalent self.reader. Probably has no effect, but feels safer. * Update tests to use close(). * Note: While many tests pass on Linux either way, a large proportion of the existing unit tests fail on Windows without these changes. * Include changes to many doctest examples - Demonstrate good practice in the examples. * Also, migrate tests to use TEMPDIR where they were not using it. * test_duration(): also corrected a bug in the test (described in Zulko#598). This bug is also been addressed in Zulko#585, so a merge will be required. * Add two new test files: * test_resourcereleasedemo exercises the path where close is not called and demonstrates that there is a consistent problem on Windows. Even after this fix, it remains a problem that if you don't call close, moviepg will leak locked files and subprocesses. Because the problem remains until the process ends, this is included in a separate test file.] * test_resourcerelease demonstrates that when close() is called, the problem goes away. * Update documentation to include usage tips for close() Not included: * Example code has not been updated to use close().
…Apps\moviepy with conflicts.
Also, make runnable directly (to help debugging)
Old versions of urlretrieve have old certificates which means one of the video downloads was failing. Also requires changes to setup.py, to come.
Including adding ranges, removing unnecessary entries, adding missing entries, adding environment markers, changing versions, and updating pytest parameter handling.
Remove conditional installations repeating the rules in setup.py Remove some installation of test needs repeating the rules in setup.py Add testing of installation options.
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #629 with based on the provided code.
Does NOT include any unit tests to show it is fixed and prevent regression. Have requested an example.