28 Commits

Author SHA1 Message Date
James McBride
8d655baff0 Test de-registration of GTiff driver 2017-05-08 08:54:02 -07:00
Kevin Wurster
4bce1e8456 Actually keep track of whether or not the drivers are registered. 2017-04-26 23:31:03 -04:00
Kevin Wurster
dce70ca72d Remove unnecessary 'rasterio.Env()' calls. 2017-04-13 19:36:11 -04:00
Sean Gillies
787d618720 Merge pull request #997 from mapbox/issue996
Better defined and tested concurrent Envs
2017-03-28 16:20:58 +02:00
Sean Gillies
a7e6747aa7 Make discovered_options a thread local variable 2017-03-24 14:13:35 +01:00
Sean Gillies
861e45ad71 Inheritance and isolation of config for child threads
The main thread uses CPLSetConfigOption and thus child threads
inherit from main's configuration. Child threads use the thread
local version and are thus isolated from each other.

Tests of this behavior have been added and documentation added
to _env (and soon to the manual).
2017-03-17 12:55:35 +01:00
Kevin Wurster
86a2eab52a Flag tests requiring network access with '@pytest.mark.network'. Running "$ pytest -m 'not network'" will skip the tests requiring network access. 2017-03-16 21:35:35 -04:00
Ben Lewis
6d60417fb1 update tests concerning local._env 2017-03-15 12:07:23 +11:00
Kevin Wurster
2d221046bc Test environment discovery with the environment defaults. 2017-02-13 19:00:54 -05:00
Kevin Wurster
94162bb012 Test fix. 2017-02-13 18:23:06 -05:00
Kevin Wurster
db8fe2381f Don't explicitly cast config option names to uppercase. GDAL does this on its own and we want to know if this behavior ever changes. 2017-02-13 18:20:41 -05:00
Kevin Wurster
279901a40e Probe the GDAL environment when the outermost 'rasterio.Env()' starts to see if any of the input config options also exist in the GDAL environment. Previously they would have been overwritten when 'rasterio.Env()' tears down, but now they are preserved and reinstated. See the note above 'rasterio.env._env' for more information. 2017-02-13 18:14:13 -05:00
Kevin Wurster
9d298e2087 Don't include casting to uppercase in normalization process. Apparently GDAL does that on its own. Add docstrings for GDAL config accessors. 2017-02-13 17:48:00 -05:00
Kevin Wurster
069960b7cb Option to disable key and value normalization. 2017-02-13 17:36:26 -05:00
Kevin Wurster
b137b6d209 Set 'rasterio.env._env = None' when tearing down the outer environment. 2017-02-06 15:26:48 -05:00
Kevin Wurster
b3cd5cc1b6 Ensure rasterio.Env() tears down properly when no parent environment exists. 2017-02-06 14:53:37 -05:00
Sean Gillies
2564e93658 Finish renaming, add a exc_wrap_vsilfile() 2017-01-11 13:01:30 +01:00
Sean Gillies
83d4b05026 Switch to configuring GDAL only when Env is entered 2016-10-05 11:41:18 +02:00
Sean Gillies
2f1ee243ba Push and pop error handler within Env context
Closes #876
Closes #902
2016-10-05 11:41:18 +02:00
Sean Gillies
816ff3e8c4 Test that --aws-profile > environment variables 2016-07-26 13:03:29 -06:00
Sean Gillies
3d058f766f Add a test of AWS profile option
Tested using a new --credentials option for rio-env.

Towards a resolution of #838
2016-07-26 11:56:42 -06:00
Matthew Perry
668b47226a use default_options in test_env 2016-06-11 09:07:23 -04:00
Erik Seglem
44c3d9badf Replace drivers with Env in docs and examples (#760)
Replace rasterio.drivers with rasterio.Env.
2016-06-02 19:01:18 -07:00
Matthew Perry
90721683d5 initial implementation of per-dataset mask 2016-05-20 09:33:37 -04:00
Sean Gillies
e7fde7e672 Rename decorator ensure_env 2016-05-06 12:19:31 -06:00
Sean Gillies
eb6201a5cc Raise EnvError if user sets AWS GDAL config options 2016-04-28 16:57:46 -06:00
Sean Gillies
5fea5210a0 Improved env implementation and tests. 2016-04-28 15:26:55 -06:00
Sean Gillies
12f8fc7e3f New, lazier AWS sessions
New Env class and tests.
More logging, tests, safer environment
Remove usage (deprecated) of rasterio.drivers()
Also pep8 cleanups throughout the tests and a fix for unchecked
dtypes when opening a dataset in 'w' mode.
Now we can simply import warnings in __init__.py. In the
deprecations tests, we needed to see a single warning only one
time to avoid multiple drivers() warnings.
Add a global env.
Add rasterio.env.setenv()
2016-04-28 15:26:55 -06:00