ApeWorX / ApeWorX/py-solc-x

cross-platform installation

Open
#143 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
142
Forks
50
PR merge metrics
No merged PRs in 30d

Description

### Overview

It seems that `solcx` is tied to the platform it is running on, meaning that it will load and install binaries for the current platform.
For cross-platform use, it would be useful to request binaries for another platform, e.g. when preparing mounts for a virtual machine, or a docker image.

The following code achieves what I want (assuming that the target platform is Linux):

```python
import solcx.install
solcx.install._get_os_name.__code__ = (lambda:"linux").__code__
```

The assignment patches the internal function `_get_os_name` to return always "linux". Obviously, this not a clean solution, as it breaks when the private function is changed. Is there a better solution?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.