Comments (7)
I think I can write a hacky workaround for this using the mock
library
from dnppy.
There is a pretty decent thread on mock
at stack-overlfow.
In the meantime, I've started to go through and remove a few arcpy dependencies. This has been a long term goal of ours anyways, might as well get started.
from dnppy.
Nice find, if you run into some modules you can't remove the arcpy dependency for you can always commit those modules that cause the error and I can try and fix them.
I'm also working on getting the travis-sphinx
to detect sphinx build warnings (like misspelling modules). The problem is the exceptions thrown for stuff like this are already handled by sphinx meaning I can't catch them myself and have no way to detect them. There is a solution out there I just need to find one
build warnings should result in an error not a successful build , so although the docs are technically passing I want to make the requirements for a build to pass much more strict
EDIT: Got it, warnings will now result in errors
from dnppy.
I usually review the logs at https://travis-ci.org/NASA-DEVELOP/dnppy after a build, but since technically all the issues I've been having are warnings and not errors, it does technically achieve a build passing
. It doesn't really hurt anything to finish the build even with warnings, it just means its a good idea to check out the logs from time to time and verify no errors are present.
The download module page works now, there was only one arcpy call and I was able to slide gdal in there pretty easily. This has prompted me to take a better inventory of all the arcpy calls, which I've been meaning to do anyway.
from dnppy.
I've got it. Running this script:
def module_mock(module):
""" attempts to import a module, mocks it upon exception """
try:
return __import__(module)
except ImportError:
print("{0} is being mocked!".format(module))
import mock
return mock.MagicMock()
arcpoops = module_mock("arcpoops")
output = arcpoops.function("args")
print(output)
Will produce the following output
>>> arcpoops is being mocked!
>>> <MagicMock name='mock.function()' id='46754480'>
I just need to place a function like this inside the core module, and replace all 27 remaining occurrences of import arcpy
with something like
from core import module_mock
arcpy = module_mock("arcpy")
Unless we can think of an even simpler way to do it?
from dnppy.
I believe you can abstract this so it won't actually modify your existing codebase, see this link
from dnppy.
That was definitely simpler. All module import related issues for travis-ci are now fixed.
from dnppy.
Related Issues (20)
- Upload releases to PyPi
- Request: Some support for FIRMS data
- Installation failure when upgrading numpy 7 to 9. permission denied upon programmatic deletion
- easy install did not install all dependencies HOT 2
- Issue with installation of dnppy HOT 2
- Getting an error message when running toa reflectance corrections HOT 7
- 'str' object is not callable during easy_install.py HOT 2
- cloud_mask.py help HOT 5
- null_set_range does not support multi-band tiffs. Results in 'list' object has no attribute 'NoData_Value' error HOT 2
- null_define does not remove desired value HOT 2
- Fmask Error: output argument "clr_pct"... HOT 12
- raster.apply_linear_correction results in integer values
- After Install HOT 2
- Wrong SAVI formula in surface_temp.py HOT 1
- Landsat metadata file error
- NotInitialized error when importing arcpy
- Any help on how to load UAVSAR into Arcmap after create_header
- Install error
- Migration of solar module to python 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnppy.