Comments (15)
I found this radish-bdd/radish@2723dbf
and made the changes to the radish/utils.py on my local machine and I no longer get the
OSError: Location 'c' to load modules does not exist error.
This is what I changed:
separator = ";" if os.name == "nt" else ":"
return list(x for x in itertools.chain(*(x.split(separator) for x in basedirs)) if x)
# return list(x for x in itertools.chain(*(x.split(":") for x in basedirs)) if x)
So it looks like the 0.1.10 radish version works fine on Linux but not on Windows because of the : separator.
from cli.
Well, radish-bdd has the fix in it (0.11.1) under radish-bdd/radish. What I am not clear with is do we need radish and radish-bdd or does radish-bdd now include radish?
If they are separate I guess I need to create PR against radish. I will post a question on their repo.
from cli.
I got a message from Timo (from radish-bdd). I guess the official release that includes the fix for the separator issue for Windows is v0.12.0. I had built from the source and it had the change but it was still tagged to 0.11.1. i guess it had not been officially released. Now it is.
So I think you will need to bump the requirement to 0.12.0. Sorry for the confusion.
from cli.
I am not sure if it supports Python3.
Perfectly working python versions for me:
karthik@server:~/terraform-compliance$ python --version
Python 2.7.15rc1
karthik@server:~/terraform-compliance$ pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
karthik@server:~/terraform-compliance$ pip list | grep radish
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
radish (0.1.10)
radish-bdd (0.10.0)
from cli.
Thanks for the reply. I did install Python 2.7 and 2 out of the 3 errors were resolved (the parentheses issue and the xrange issue). I guess both of those are different in Python 3.
I still got the second error though regarding OSError: Location 'c' to load modules does not exist.
It looks like the radish package version you have working are not exactly what I get when installing with "pip install terraform-compliance". I get radish 0.1.10 and radish-bdd 0.11.1
If I remove both radish and radish-bdd (via pip) and then install radish-bdd 0.11.1 from the source (clone and run setup.py) then terraform-compliance works for me.
from cli.
Hello,
Sorry for the late reply. Currently there is no support for Python 3, but yes this is one of the long term plans.
If you are having problems with the environment, I would strongly recommend to run in a docker container
[~] $ function terraform-compliance { docker run --rm -v
from cli.
By the way, the only problems are not xrange and print statements. There are more problematic cases on resource mounting functions within the code.
I think we need to work on supporting Pyhton 3, but lots to do till we get that point :)
from cli.
I am reopening this because I can get terraform-compliance to work cleanly after am install (in my my case "pip uninstall radish radish-bdd terraform-compliance" then "pip install terraform-compliance".
I am on a Windows 10 64 bit machine.
This is the error I get (which seems to be radish related):
C:\tmp>terraform-compliance --features infrastructure-compliance/aws --tfdir commonservices-tf
terraform-compliance v0.5.4 initiated
Steps : c:\python27\lib\site-packages\terraform_compliance\steps
Features : C:\tmp\infrastructure-compliance\aws
TF Files : c:\users\abs123\appdata\local\temp\tmpivmzhr (commonservices-tf)
Reading terraform files.
All HCL files look good.
Running tests.
Error: Location 'c' to load modules does not exist
Traceback (most recent call last):
File "c:\python27\lib\site-packages\radish\errororacle.py", line 61, in _decorator
return func(*args, **kwargs)
File "c:\python27\lib\site-packages\radish\main.py", line 221, in main
return method(core)
File "c:\python27\lib\site-packages\radish\main.py", line 65, in run_features
load_modules(basedir)
File "c:\python27\lib\site-packages\radish\loader.py", line 22, in load_modules
raise OSError("Location '{0}' to load modules does not exist".format(location))
OSError: Location 'c' to load modules does not exist
Here is my version information:
C:\tmp>python --version
Python 2.7.14
C:\tmp>pip --version
pip 19.0.3 from c:\python27\lib\site-packages\pip (python 2.7)
C:\Users\abs123>pip show radish
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: radish
Version: 0.1.10
Summary: A set of common tools for testing django projects with lettuce.
Home-page: http://ff0000.com/
Author: Red Interactive
Author-email: [email protected]
License: UNKNOWN
Location: c:\python27\lib\site-packages
Requires: random-instances, selenium
Required-by: terraform-compliance
C:\Users\abs123>pip show radish-bdd
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: radish-bdd
Version: 0.11.1
Summary: Behaviour-Driven-Development tool for python
Home-page: http://radish-bdd.io
Author: Timo Furrer
Author-email: [email protected]
License: MIT
Location: c:\python27\lib\site-packages
Requires: colorful, humanize, pysingleton, docopt, tag-expressions, parse-type
Required-by: terraform-compliance
C:\Users\abs123>pip show terraform-compliance
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: terraform-compliance
Version: 0.5.4
Summary: BDD test framework for terraform
Home-page: https://github.com/eerkunt/terraform-compliance
Author: Emre Erkunt
Author-email: [email protected]
License: MIT
Location: c:\python27\lib\site-packages
Requires: radish, gitpython, netaddr, radish-bdd, terraform-validate
Required-by:
from cli.
Great find! I think you should create a PR against radish-bdd
. They are quite fast on reviewing stuff.
from cli.
Radish-bdd is the main interface we use. If 0.11.1 has the fix, then I will change the requirements.txt about this issue.
Thanks a lot for the troubleshooting!
from cli.
@anthonycolon25 can you confirm the new terraform-compliance works for you ?
from cli.
Thanks for chasing this up! Will release a new version within today
from cli.
Hi,
0.12.0 is released but still not in PyPi. Can't do much without it is released into PyPi.
Will wait more about this.
from cli.
Hi @anthonycolon25,
terraform-compliance-0.5.6
is released with radish-0.12.1
support and few fixes.
Could you please have a try ?
from cli.
Please note that terraform-compliance 0.6.0
is now Python 3.7 compliant.
from cli.
Related Issues (20)
- cleanup tmp HOT 3
- --coverage flag with docker HOT 1
- FATAL ERROR: Unsupported terraform version (1.4.0). HOT 4
- Support for Terraform 1.4.* HOT 2
- Add support for testing the terraform block HOT 1
- tagging feature - false positive for aws_lambda_function's "environment" argument HOT 2
- Terregarrunt support
- Applying test cases to only resources from specific provider HOT 1
- Support for Terraform 1.5.* HOT 8
- Can not find aws_msk_cluster defined in target terraform plan
- Question: Using Terraform Compliance in CircleCI with Terraform and Python Orbs HOT 4
- Add support for Terraform Version 1.6.0 HOT 4
- Is `or` logic supported at all? HOT 1
- STDERR isn't being used, log level cannot be changed.
- THEN's condition matches for child properties in absence of a property at expected level. Is this expected? HOT 1
- 'AttributeError: 'str' object has no attribute 'append'' HOT 2
- "AttributeError: 'dict' object has no attribute 'startswith'" when using resources defining their own "references" blocks
- FATAL ERROR: Unsupported terraform version (1.7.0)
- Get rid of "/root/.cache" directory
- When condition on resource which has its own type property fails HOT 1
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 cli.