Skip to content

Commit

Permalink
integration: Fix integration files are not included
Browse files Browse the repository at this point in the history
Also Broken at 929daf4
  • Loading branch information
SilverRainZ committed Mar 13, 2024
1 parent a8ba14b commit 341afe6
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@ version_scheme = "no-guess-dev"
where = ["src"]

[tool.setuptools.package-data]
integration = ["integration/*"]
# A maps from PACKAGE NAMES to lists of glob patterns,
# see also https://setuptools.pypa.io/en/latest/userguide/datafiles.html
"sphinxnotes.snippet.integration" = ["*.*"]
6 changes: 5 additions & 1 deletion src/sphinxnotes/snippet/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ def get_integration_file(fn:str) -> str:
"""
Get file path of integration files.
.. note:: files are included by ``setup(package_data=xxx)``
.. seealso::
see ``[tool.setuptools.package-data]`` section of pyproject.toml to know
how files are included.
"""
# TODO: use https://docs.python.org/3/library/importlib.resources.html#importlib.resources.files
prefix = path.abspath(path.dirname(__file__))
return path.join(prefix, 'integration', fn)

Expand Down
11 changes: 11 additions & 0 deletions src/sphinxnotes/snippet/integration/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
sphinxnotes.snippet.integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dummpy module for including package_data.
See also ``[tool.setuptools.package-data]`` section of pyproject.toml.
:copyright: Copyright 2024 Shengyu Zhang
:license: BSD, see LICENSE for details.
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 341afe6

Please sign in to comment.