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

needimport ignores all links between needs #227

Closed
arnoox opened this issue Apr 14, 2021 · 7 comments · Fixed by #234
Closed

needimport ignores all links between needs #227

arnoox opened this issue Apr 14, 2021 · 7 comments · Fixed by #234

Comments

@arnoox
Copy link

arnoox commented Apr 14, 2021

I have a proper needs.json containing some valid needs that are linked to each other. Now when I "needimport" this file, all needs are imported, but without links. I couldn't find a hint in the documentation, that specifies this behavior: https://sphinxcontrib-needs.readthedocs.io/en/latest/directives/needimport.html

Probably this is a bug? Or are there any other way to achieve this?

@arnoox
Copy link
Author

arnoox commented Apr 14, 2021

Hint: I could reproduce this with version sphinx-build 3.5.3.

@danwos
Copy link
Member

danwos commented Apr 15, 2021

Thanks for sharing this bug report.

I can reproduce the bug for extra_links.
So links via :links: options are working for me.
They get exported to needs.json and imported back.
@arnoox: Can you confirm this?

Only for additional links (configured via needs_extra_links) I get this problem.

They are not exported to needs.json.
I changed the needs.json by hand to get the links into it.
But also need_import ignores them.

So I see two bugs here, both related to needs_extra_links:

  • Needs-builder does not export them
  • and need_Import does not import them.

@arnoox
Copy link
Author

arnoox commented Apr 16, 2021

I can confirm that everything is working fine for regular :links:. They get properly exported; they also are properly imported.

In my case, the needs_extra_links:

  • seem to be exported properly using sphinx-build -b needs docs/ build/
  • are not imported at all using .. needimport:: path/to/needs.json

danwos added a commit that referenced this issue Apr 17, 2021
* extra options and links are imported
* pre/post/template can be defined by needimport
* same for style and layout

Fixes #227
danwos added a commit that referenced this issue Apr 19, 2021
* needimport supports extra options and links

* extra options and links are imported
* pre/post/template can be defined by needimport
* same for style and layout

Fixes #227

* Updated dep MarkupSafe to use newest version

* Cleanup and type annotation for needimport
@arnoox
Copy link
Author

arnoox commented Apr 21, 2021

Thanks for fixing!

I wanted to test this by locally installing sphinxcontrib-needs, but I failed because setup.py was apparently deprecated: so the following install steps from the README don't work anymore: python setup.py install

@danwos : could you please provide the updated install steps?

@twodrops
Copy link
Collaborator

@arnoox The new instructions to build from sources are here https://github.com/useblocks/sphinxcontrib-needs/blob/master/docs/contributing.rst

I guess the Readme update was missed during the Poetry migration.

@danwos Do you want to point to contributing.rst from Readme?

@danwos
Copy link
Member

danwos commented Apr 21, 2021

Thanks for the hint 👍 and I have updated the docs.
I think you can use pip install -e . to install from source.

@twodrops
Copy link
Collaborator

@danwos @arnoox
pip install -e . does not seem to work without a setup.py. I created a new issue here #241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants