Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init process does not work. #7

Closed
iiwolf opened this issue Jul 8, 2024 · 5 comments · Fixed by #8
Closed

Init process does not work. #7

iiwolf opened this issue Jul 8, 2024 · 5 comments · Fixed by #8
Assignees
Labels
bug Something isn't working

Comments

@iiwolf
Copy link

iiwolf commented Jul 8, 2024

Hello, I just found this package and tried to adr init and adir init docs/adr and I get this error:

│ C:\Users\WolfI\Anaconda3\envs\saga-3.11\Lib\site-packages\adrpy\repositories\adr\repository.py:2 │
│ 0 in create                                                                                      │
│                                                                                                  │
│   17 │                                                                                           │
│   18 │   def create(self, adr_name: str, template: RenderedTemplate) -> None:                    │
│   19 │   │   print(self.settings)                                                                │
│ ❱ 20 │   │   self.settings.adr_dir.mkdir(parents=True, exist_ok=True)                            │
│   21 │   │   with open(                                                                          │
│   22 │   │   │   self.settings.adr_dir / self.__get_filename_with_extension(name=adr_name), "
│   23 │   │   ) as file:                                                                          │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ adr_name = '0001-record-architecture-decisions'                                              │ │
│ │     self = <adrpy.repositories.adr.repository.ADRFileRepository object at                    │ │
│ │            0x000001ECF7D664D0>                                                               │ │
│ │ template = RenderedTemplate(                                                                 │ │
│ │            │   name='initial-adr.md',                                                        │ │
│ │            │   content='# 1. Record architecture decisions\n\nDate: 08/07/2024 10:37\n\n##   │ │
│ │            Status\n\nACCEPTED\n'+324                                                         │ │
│ │            )                                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'mkdir'

From the documentation, my understanding is I just run this and initializes the report to use adr properly? Namely, looks like self.settings.adr_dir is not being set.

Thanks!

@AlTosterino
Copy link
Owner

Hey!

Thanks for the report -- I was able to reproduce this issue (wrong order of injection, and how the None path is handled), and I'll fix it today

Have a great day 🎉

@AlTosterino AlTosterino added the bug Something isn't working label Jul 9, 2024
@AlTosterino AlTosterino self-assigned this Jul 9, 2024
@AlTosterino AlTosterino linked a pull request Jul 9, 2024 that will close this issue
@AlTosterino
Copy link
Owner

@iiwolf
Hey! Are you able to git clone this PR: #8 and do: pip install -e . inside the cloned directory? It will install adrpy from your local machine and you can check if the problem still exists.

Thanks in advance

@iiwolf
Copy link
Author

iiwolf commented Jul 11, 2024

Hey @AlTosterino thank you for the quick response - yes I will try to do that in the next few hours!

@AlTosterino
Copy link
Owner

@iiwolf Hey! Did you have time to check if the issue is resolved? 😃

@iiwolf
Copy link
Author

iiwolf commented Aug 6, 2024

Apologies for lack of response - I can confirm it works know though. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants