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

Comments

Projects
None yet
2 participants
@MirkoRossini
Contributor

MirkoRossini commented Sep 22, 2014

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

This comment has been minimized.

Show comment
Hide comment
@mriehl

mriehl Sep 22, 2014

Member

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!

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

This comment has been minimized.

Show comment
Hide comment
@MirkoRossini

MirkoRossini Sep 22, 2014

Contributor

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

Contributor

MirkoRossini commented Sep 22, 2014

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 in f2e63ec Sep 23, 2014

@mriehl

This comment has been minimized.

Show comment
Hide comment
@mriehl

mriehl Sep 23, 2014

Member

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!

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

This comment has been minimized.

Show comment
Hide comment
@mriehl

mriehl Sep 23, 2014

Member

@aelgru do you want to review/release this?

Member

mriehl commented Sep 23, 2014

@aelgru do you want to review/release this?

@MirkoRossini

This comment has been minimized.

Show comment
Hide comment
@MirkoRossini

MirkoRossini Sep 23, 2014

Contributor

Thanks for the quick fix!

Contributor

MirkoRossini commented Sep 23, 2014

Thanks for the quick fix!

@mriehl

This comment has been minimized.

Show comment
Hide comment
@mriehl

mriehl Sep 24, 2014

Member

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

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