Skip to content

Commit

Permalink
better files distrib logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pierky committed Feb 7, 2017
1 parent b3f286c commit 3dc7244
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
13 changes: 4 additions & 9 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ include CHANGES.rst
include MANIFEST.in
include requirements.txt
recursive-include pierky *.py
recursive-include config.d *.*
recursive-include templates *.*
recursive-include tests *.py
recursive-include tests *.json
recursive-include tests *.yml
recursive-include tests *.j2
recursive-include tests Dockerfile.*
recursive-include examples *.conf
recursive-include examples *.yml
recursive-include pierky/arouteserver/config.d
recursive-include pierky/arouteserver/config.d *
recursive-include pierky/arouteserver/templates
recursive-include pierky/arouteserver/templates *
1 change: 1 addition & 0 deletions pierky/arouteserver/config.d
7 changes: 3 additions & 4 deletions pierky/arouteserver/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# along with this program. Ifnot, see <http://www.gnu.org/licenses/>.

import os
from pkg_resources import Requirement, resource_filename
#from pkg_resources import Requirement, resource_filename
import pkg_resources

from errors import ResourceNotFoundError

Expand All @@ -24,9 +25,7 @@ def get_local_dir(dirname):
if os.path.isdir(local_path):
return local_path

pkg_path = resource_filename(
Requirement.parse("arouteserver"), "arouteserver/{}".format(dirname)
)
pkg_path = pkg_resources.resource_filename("pierky.arouteserver", dirname)
if os.path.isdir(pkg_path):
return pkg_path

Expand Down
1 change: 1 addition & 0 deletions pierky/arouteserver/templates
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@

packages=["pierky", "pierky.arouteserver"],
namespace_packages=["pierky"],
data_files=[
("/arouteserver/config.d", [os.path.join("config.d", f) for f in os.listdir("config.d")]),
("/arouteserver/templates/bird", [os.path.join("templates/bird", f) for f in os.listdir("templates/bird")]),
],
package_data={
"pierky.arouteserver": ["pierky/arouteserver/config.d/*",
"pierky/arouteserver/templates/*"]
},
include_package_data=True,

license="GPLv3",
Expand Down

0 comments on commit 3dc7244

Please sign in to comment.