Skip to content
This repository was archived by the owner on Jul 20, 2022. It is now read-only.

Commit 04ae7e7

Browse files
committed
Beta release 0.5.2
1 parent 061ce10 commit 04ae7e7

26 files changed

+33
-23
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include LICENSE
2+
recursive-include src/ansibleautodoc/templates *

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Note: this project is currently in Beta, issues, ideas and pull requests are wel
1010
* tags: the autodoc will search for used tags in the project
1111

1212
# Installation
13-
## Manual
14-
1. download / git clone this project
15-
2. run `install.py` Note sudo is required ( I use this locally while developing)
13+
## Manual (for dev)
14+
1. download / git clone this project
15+
2. cd ansible-autodoc
16+
3. `pip install -e ./`
1617

1718
## Pip
1819
using pip
@@ -129,11 +130,17 @@ if they have been annotated more than once or if there are tags used in more tha
129130
* r.fprn(role_name,replace_value="Playbook"): "filter playbook role name" replace the internal playbook role name
130131
"_ansible_playbook_" with a different value.
131132

132-
# changelog
133+
# changelog
133134

134-
2019/02/17 - Version 0.5.1
135+
2019/02/17 - Version 0.5.2
136+
* FIX: run only in playbook or role project
137+
* add -V | --version to cli
138+
* solve pip install issues
139+
140+
2019/02/17 - Version 0.5.1.1
135141
* add missing feature @example
136142
* improve default template "readme"
143+
* update install dependency on yaml for pip
137144

138145
2019/02/17 - Version 0.5.0
139146
* added uint tests

setup.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
sys.path.insert(0, os.path.abspath('src'))
88
from ansibleautodoc import __version__
99

10+
1011
try:
1112
from setuptools import setup, find_packages,Command
1213
except ImportError:
13-
print("ansible-docgen needs setuptools in order to build. Install it using"
14+
print("ansible-autodoc needs setuptools in order to build. Install it using"
1415
" your package manager (usually python-setuptools) or via pip (pip"
1516
" install setuptools).")
1617
sys.exit(1)
@@ -50,9 +51,9 @@ def get_template_files():
5051
long_description=long_description,
5152
long_description_content_type="text/markdown",
5253
url="https://github.com/AndresBott/ansible-autodoc",
53-
package_dir={
54-
'': 'src'},
54+
package_dir={'': 'src'},
5555
packages=find_packages("src"),
56+
include_package_data=True,
5657
classifiers=[
5758
'Environment :: Console',
5859
'Intended Audience :: Developers',
@@ -70,16 +71,12 @@ def get_template_files():
7071
],
7172
install_requires=[
7273
'jinja2',
73-
'yaml',
74+
'pyyaml',
7475
],
7576
setup_requires=['setupext'],
7677
scripts=[
7778
'src/bin/ansible-autodoc',
7879
],
79-
data_files = [
80-
("", ["LICENSE"]),
81-
("templates",template_files)
82-
],
8380
cmdclass=cmd_classes,
8481

8582
)

src/ansibleautodoc/AutodocCli.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from ansibleautodoc.Config import SingleConfig
99
from ansibleautodoc.DocumentationParser import Parser
1010
from ansibleautodoc.DocumentationGenerator import Generator
11+
from ansibleautodoc import __version__
1112

1213
class AnsibleAutodoc:
1314

@@ -47,6 +48,7 @@ def _cli_args(self):
4748
parser.add_argument('-p', nargs='?', default="_unset_", help='use print template instead of writing to files, '
4849
'sections: all, info, tags, todo, var')
4950

51+
parser.add_argument('-V',"--version", action='store_true', help='Get versions')
5052

5153
debug_level = parser.add_mutually_exclusive_group()
5254
debug_level.add_argument('-v', action='store_true', help='Set debug level to info')
@@ -61,9 +63,6 @@ def _parse_args(self,args):
6163
:param args:
6264
:return: None
6365
"""
64-
65-
print(args.project_dir)
66-
6766
self.config.set_base_dir(os.path.abspath(args.project_dir))
6867

6968
# search for config file
@@ -87,6 +86,11 @@ def _parse_args(self,args):
8786
print(self.config.sample_config)
8887
sys.exit()
8988

89+
# version
90+
if args.version:
91+
print(__version__)
92+
sys.exit()
93+
9094
# Debug levels
9195
if args.v is True:
9296
self.log.set_level("info")
@@ -127,7 +131,7 @@ def _parse_args(self,args):
127131

128132
if self.config.is_role:
129133
self.log.info("This is detected as: ROLE ")
130-
elif not self.config.is_role:
134+
elif self.config.is_role is not None and not self.config.is_role:
131135
self.log.info("This is detected as: PLAYBOOK ")
132136
else:
133137
self.log.error([

src/ansibleautodoc/Config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ def get_template_base_dir(self):
210210
:return: str abs path
211211
"""
212212
if self.use_print_template:
213-
return os.path.realpath(self.script_base_dir+"/../templates/cliprint")
213+
return os.path.realpath(self.script_base_dir+"/templates/cliprint")
214214

215215
if self.template == "":
216216
template = self.default_template
217217
else:
218218
template = self.template
219219

220220
if self.template_dir == "":
221-
return os.path.realpath(self.script_base_dir+"/../templates/"+template)
221+
return os.path.realpath(self.script_base_dir+"/templates/"+template)
222222
elif os.path.isabs(self.template_dir):
223223
return os.path.realpath(self.template_dir+"/"+template)
224224
elif not os.path.isabs(self.template_dir):

src/ansibleautodoc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
name = "ansibleautodoc"
2-
__version__ = '0.5.1'
2+
__version__ = '0.5.2'
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)