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

Failed to install on MacOS #155

Open
dmranck opened this issue Aug 3, 2018 · 19 comments
Open

Failed to install on MacOS #155

dmranck opened this issue Aug 3, 2018 · 19 comments

Comments

@dmranck
Copy link

dmranck commented Aug 3, 2018

Any way this can be installed on a Mac?

I have the rpm command installed from "brew install rpm". I'd like the rpm python bindings installed as well. Any help would be appreciated!

When I attempt to install with pip, I receive the following in a stack trace:

raise InstallError('Supported platform is Linux only.')

@junaruga
Copy link
Collaborator

junaruga commented Aug 3, 2018

@dmranck Yeah, the message in the stack trace is correct.
I did not imagine this tool could be used on Mac and rpm existed as a brew package!
Right now this tool supports Feodra, CentOS, Ubuntu Linux.
https://github.com/junaruga/rpm-py-installer/blob/master/.travis.yml

What is your use case on Mac?
Why do you want to use rpm on Mac?

@dmranck
Copy link
Author

dmranck commented Aug 3, 2018

@junaruga thanks for the quick response!

I'm currently using the rpm command on a Mac to look at the headers in a rpm file. i.e.:

rpm -qp <rpm_name> --qf '%{VENDOR}\n'

I'm able to do it through a subprocess in python, but I'd rather do it in native python if possible. It looks like the rpm-python package would allow me to do this.

@junaruga
Copy link
Collaborator

junaruga commented Aug 4, 2018

@dmranck Thanks for sharing it.
Yeah, maybe the RPM Python binding makes your work easier.
As I am working for some higher priority issues, this feature could be later in the future. Please do not expect it is implemented soon.
But I will keep note!

Could you share us your environment more?

  • Mac OS X version
  • rpm --version
  • which rpm,
  • Python version (python3 --version or python --version)
  • which python. (Pythons that could be used)

Thanks!

@junaruga
Copy link
Collaborator

junaruga commented Aug 4, 2018

@dmranck
Copy link
Author

dmranck commented Aug 6, 2018

Great, thanks @junaruga.

Mac OS X version: macOS High Sierra - 10.13.6
rpm --version: RPM version 4.14.1
which rpm: /usr/local/bin/rpm
Python version: Python 3.5.5
which python: /Users/dranck/miniconda2/envs/content_testing_3/bin/python (I'm using conda for virtualenvs)

Also, I found this last week during my debugging and figured I can share it here: stepanstipl/homebrew-noop#2

I'll let you know if I get it installed anytime soon. Thanks again. :)

@tkdchen
Copy link
Contributor

tkdchen commented Jan 21, 2020

My case is I would like to install dependencies including koji into the system directly rather than provision a virtual environment inside a VM and run tests just inside host.

@PyvesB
Copy link

PyvesB commented Aug 20, 2020

Hey there! 👋🏻

Different use case here: I generally develop RPM spec files on my macOS machine. The Eclipse IDE provides a decent editor for such files and supports an integration with rpmlint, VS Code provides something similar as well. Unfortunately, rpmlint requires the Python RPM bindings to work. As they aren't available on macOS, IDE features are lessened.

@junaruga
Copy link
Collaborator

Hi @PyvesB !
Thanks for the information.

@jayvdb
Copy link

jayvdb commented Dec 28, 2021

I tried to get the brew rpm formula to install the python bindings, and ran into issues described at Homebrew/discussions#2693 , which don't look too difficult to solve.

Getting rpm-py-installer to do its own build of rpm is going to involve similar steps, but if building directly from source it quite possibly avoids the problems encountered by using brew formula.

@TomasTomecek
Copy link

As Packit requires rpm-py-installer transitively, we're also on the same boat as everyone else: one of our users is asking for this support to develop RPM packages on MacOS.

@junaruga
Copy link
Collaborator

I see. Thanks for sharing the info!

@junaruga
Copy link
Collaborator

junaruga commented Jul 28, 2022

We migrated the CI from Travis to GitHub Actions by #245 . Now the first step for this feature is to add MacOS case to GitHub Actions.

@ssbarnea
Copy link

@junaruga I am looking forward too see macos support enabled because the current situation is awful when trying to install it on macos as it fails with a long tracedump. Another issue is the library is using the heavily discourage setup.py, while the most modern model is supposed to use PEP-621 (pyproject.toml alone, yep even setup.cfg is considered old-school).

The installation issue can be done declaratively using a trick like the one from https://github.com/ansible/ansible-lint/blob/main/setup.cfg#L66 where you add a dependency that does not exist on unsupported platform. That is very fast compared with the other approaches.

Also the trove classifiers are wrong as they should include only Operating System :: POSIX :: Linux" if Linux is required, or Operating System :: POSIX` if also MacOS. Currently there is no OS mentioned there.

@junaruga
Copy link
Collaborator

junaruga commented Nov 27, 2022

I am looking forward too see macos support enabled because the current situation is awful when trying to install it on macos as it fails with a long tracedump.

Sorry for the inconvenience for the macOS case. I tried to reinstall macOS on my old Macbook Air, and after deleting the MacOS, I can't find how to reinstall macOS. I really needs someone's help. Now I am only using Linux on both my work and private.

Another issue is the library is using the heavily discourage setup.py, while the most modern model is supposed to use PEP-621 (pyproject.toml alone, yep even setup.cfg is considered old-school).

I see. I am not following the latest situation.

The installation issue can be done declaratively using a trick like the one from https://github.com/ansible/ansible-lint/blob/main/setup.cfg#L66 where you add a dependency that does not exist on unsupported platform. That is very fast compared with the other approaches.

Thanks for the info.

Also the trove classifiers are wrong as they should include only Operating System :: POSIX :: Linux" if Linux is required, or Operating System :: POSIX` if also MacOS. Currently there is no OS mentioned there.

Thanks for the info. At least we need to add the System :: POSIX :: Linux now.

I appreciate your PRs if you like. Thanks.

@ssbarnea
Copy link

@junaruga You should be able to enter internet recovery mode, how to access it is documented at https://www.idownloadblog.com/2016/02/25/how-to-start-up-your-mac-in-internet-recovery-mode/ - be patient as it might take time to boot from network. The fast reinstall method is via an USB stick with MacOS installer, but i bet you never bothered to create one. I always keep one because it allows me to upgrade macos much faster than downloading. Obviously that you need a working macos to create a bootable usb stick.

@ssbarnea
Copy link

ssbarnea commented May 7, 2023

That is really unfortunate because rpm is a dependency of fedpkg and that makes impossible to even create a git contribution to fedora from a macos system.

@junaruga
Copy link
Collaborator

junaruga commented May 7, 2023

If you prepare the PR to support rpm-py-installer and sent it, then I would consider giving you the co-maintainer role. I feel pressure from your comment, and unfortunately, currently, my motivation for this project is close to zero.

@junaruga
Copy link
Collaborator

junaruga commented May 7, 2023

@ssbarnea perhaps you can use python -m venv or virtualenv --system-site-packages option to use the rpm brew package on the MacOS in the virtual environment.

Below is the result on my local Fedora 37 environment as a note.

$ python -m venv --help | grep system
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
  --system-site-packages
                        Give the virtual environment access to the system

@nforro
Copy link
Collaborator

nforro commented May 10, 2023

That is really unfortunate because rpm is a dependency of fedpkg and that makes impossible to even create a git contribution to fedora from a macos system.

Could fedpkg use rpm-shim instead of rpm-py-installer to satisfy the rpm dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants