zerotk / zops.anatomy Goto Github PK
View Code? Open in Web Editor NEWA tool to create and maintain projects templates.
A tool to create and maintain projects templates.
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.
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/
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
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.
Today the playbook object is a separated beast with the following aspects:
While a feature have the following aspects (as commands):
The idea is to add the aspect to use other features (use-feature) and making the playbook a "static" feature, both with all aspects:
Today some undefined variables in the templates fail in silence.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.