Giter Site home page Giter Site logo

zops.anatomy's People

Contributors

isac-caja avatar kaniabi avatar

Watchers

 avatar  avatar

Forkers

ravishi

zops.anatomy's Issues

Make the playbook look more like a feature.

Today we have a very different syntax on the playbook from the features even if they do basically the same.

Also, we must be abble to create features inside the playbook file and use them in the playbook itself.

Debug mode.

Create a debug mode where the generated files have some comments containing the source of the generated code. For example:

# .gitignore

# zops.anatomy feature:PYTHON_CODE
.pyc

# zops.anatomy feature:IDEs
/.idea/

Suport loading input data from output files.

The general idea is to keep some data to build the generated file inside the generated file itself.
For example, have a code block to build .gitignore inside the .gitignore file itself:

# .gitignore

# zops.anatomy#add-file-block
/extra
/lines
# /zops.anatomy#add-file-block

Support conditional generation of output files based on input variables

Ideally, it should be possible to conditionally generate output files based on the value of some input variables.

For example, if we have the following:

python_versions:
  - '3.6'
  - '3.7'

...then we should only generate the output Dockerfiles for Python 3.6 and Python 3.7 (instead of generating all possible Dockerfiles, which is the case currently).

Perhaps this functionality could also be further generalized to support conditional execution in general.

Playbook as a feature.

Today the playbook object is a separated beast with the following aspects:

  • variables
  • use-features

While a feature have the following aspects (as commands):

  • add-file-block
  • create-file
  • add-variables

The idea is to add the aspect to use other features (use-feature) and making the playbook a "static" feature, both with all aspects:

  • use-feature
  • add-variables
  • create-file
  • add-file-block

Bugs when installing zops inside a virtualenv managed by pyenv

I have an pyenv virtualenv in my machine that has zops installed with pip, steps to reproduce it:

$ pyenv virtualenv 3.6.2 zops
$ pyenv activate zops
$ pip install zops.anatomy

Two problems:
First, with this, I also have to install manualy the dependency ruamel.yaml

Second, when I ran zops anatomy apply, I got this error:

$ zops anatomy apply
Traceback (most recent call last):
  File "/Users/dhenrique/.pyenv/versions/zops/bin/zops", line 11, in <module>
    sys.exit(main())
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/zops/anatomy/cli.py", line 40, in apply
    _register_features()
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/zops/anatomy/cli.py", line 55, in _register_features
    AnatomyFeatureRegistry.register_from_file(filename)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/zops/anatomy/layers/feature.py", line 51, in register_from_file
    return cls.register_from_contents(contents)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/zops/anatomy/layers/feature.py", line 65, in register_from_contents
    feature = AnatomyFeature.from_contents(i_feature)
  File "/Users/dhenrique/.pyenv/versions/3.6.2/envs/zops/lib/python3.6/site-packages/zops/anatomy/layers/feature.py", line 143, in from_contents
    raise KeyError(contents.keys())
KeyError: dict_keys(['commands'])

With my previous installation, installed without pip (cloning the repo and running python setup.py install), this command works fine.

Documentation system.

Create a system to merge de anatomy-feature code with de documentation.

The idea is to make mandatory some "description" fields and provide commands to display these commands in the command line. It is important that the documentation is merged with the code so it have less chance to become obsolete.

$ zops anatomy list-features
- PYTHON_APPLICATION: Basics for all python application, including GITIGNORE.
- GITIGNORE: Create the .gitignore file providing the following extension points: lines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.