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

Add archiving option, fix exceptions, caused by multiline content in rpm spec files, remove shebangs, fix missing provides_extra field #215

Closed
wants to merge 6 commits into from

Conversation

huakim
Copy link
Contributor

@huakim huakim commented Jan 8, 2025

No description provided.

…rpm spec files, remove shebangs, fix missing provides_extra field
Copy link
Contributor

@danigm danigm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good. I think that the optional libarchive dep can be avoided using the python standard library.

Also the sanitize of multiline fields can be done in the fix_data function instead of in templates.

if 'info' not in js:
js = {'info': js}
if 'urls' not in js:
js['urls'] = []
return js


def pypi_archive_file(file_path):
if libarchive is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need libarchive new dep here? Maybe it's possible to use standard python module tarfile or zipfile?

Copy link
Contributor Author

@huakim huakim Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add if libarchive is None: pypi_archive_file_using_tarfile_or_zipfile(file_path) later here

py2pack/__init__.py Outdated Show resolved Hide resolved
py2pack/__init__.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@@ -3,13 +3,13 @@
Name: python-%{pypi_name}
Version: {{ version }}
Release: %autorelease
Summary: {{ summary }}
Summary: {{ summary|replace('\n','') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not needed to modify the templates, you have defined the new fix_data function, what if we do this sanitize operation there instead of doing it in the templates? We can add to the fix_data function something like:

    single_line_fields = ['summary', 'license', 'home_page', 'source_url']
    for field in single_line_fields:
        if field not in data_info:
            continue
        # remove line breaks to avoid multiline rpm spec file
        data_info[field] = data_info[field].replace('\n', ' ')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing these example files?

@huakim huakim closed this by deleting the head repository Jan 12, 2025
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 this pull request may close these issues.

2 participants