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

list_packages not working correctly #110

Closed
MirkoRossini opened this issue Sep 22, 2014 · 6 comments
Closed

list_packages not working correctly #110

MirkoRossini opened this issue Sep 22, 2014 · 6 comments

Comments

@MirkoRossini
Copy link
Contributor

Hello,

I just started using pyb on an existing project. I ran into a weird issue where the first letter of all packages was missing in all the packages in setup.py. i.e. I have:

packages = ['oaders', 'awdata', 'onfig',..]

instead of

packages = ['loaders', r'awdata', 'config',..]

I fixed by redefining Project.list_packages in build.py, removing the [1:] splice (see core_plugin.py)
I may be doing something wrong with my configuration, but I didn't change many default values:

from pybuilder.core import use_plugin, init
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")

name = "loader"
default_task = ["publish"]

@init
def set_properties(project):
project.set_property('coverage_break_build', False)
project.set_property("dir_source_main_python", "src/")
project.set_property("dir_source_unittest_python", "test/")
project.set_property("dir_source_main_scripts", "src/scripts/")
project.set_property("dir_dist_scripts", 'scripts')
project.depends_on_requirements("requirements.txt")
project.depends_on("django-altauth", url = "git+https://github.com/MirkoRossini/django-altauth.git")

Thanks

Mirko

@mriehl
Copy link
Member

mriehl commented Sep 22, 2014

Actually the override path properties are not supposed to have a trailing slash, that's why pybuilder is eating a character from the package.

I guess it would be cleaner to check for the trailing slash case and handle it, so that's what I'll do. Thanks for the report!

@MirkoRossini
Copy link
Contributor Author

Thanks, I'll remove the trailing slashes.
FYI I used the interactive command line interface that starts with --start-project, so those properties were automatically generated. Maybe the check should be done at that level

Mirko

mriehl added a commit that referenced this issue Sep 23, 2014
@mriehl mriehl closed this as completed in f2e63ec Sep 23, 2014
@mriehl
Copy link
Member

mriehl commented Sep 23, 2014

It's as I thought. You start out with the path to your package, say

/workspace/project/src/package/subpackage
pybuilder then removes the source path from there, which is
/workspace/project/src

so this leaves
/package/subpackage where you need to strip the leading slash.

But if your source path is
/workspace/project/src/ then you don't have that leading slash.

Both variants (trailing slash / no trailing slash) should work now. Thanks again for reporting!

@mriehl
Copy link
Member

mriehl commented Sep 23, 2014

@aelgru do you want to review/release this?

@MirkoRossini
Copy link
Contributor Author

Thanks for the quick fix!

@mriehl
Copy link
Member

mriehl commented Sep 24, 2014

I just released v0.10.35 which includes the fix to this issue.

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

No branches or pull requests

2 participants