Skip to content

Commit

Permalink
setup: adjust lib output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
hanskw-weston committed May 29, 2024
1 parent 1a632c7 commit e4e7836
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,20 @@ For development and testing, you can use inplace build
$ python setup.py build_ext --inplace
```

It will generate library files in build/temp.linux-x86_64-3.10/lib (the name could be different based on your system).
You can add the path to the PYTHONPATH environment variable to use the library. Please note that setting the PYTHONPATH directly in the shell will only affect the current session.
It will generate library files in build/temp.linux-x86_64-3.10/lib (the name could be different based on your system) and in the directory where you run the command.

You can then use the library in a python script from the same directory directly. If you want to use the library in other directories, you can add the path to the PYTHONPATH environment variable.

Please note that setting the PYTHONPATH directly in the shell will only affect the current session.

```bash
$ export PYTHONPATH=$PYTHONPATH:<path-to-the-repo>/build/temp.linux-x86_64-3.10/lib
$ export PYTHONPATH=$PYTHONPATH:<path-to-the-repo>/build/lib.linux-x86_64-3.10
```

You can also install the package to your Python environment using

```bash
$ python setup.py install
$ python3 -m pip install .
```

## Setup CAN-To-USB Adapter
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def build_extension(self, ext):
cfg = 'Debug' if debug else 'Release'

cmake_args = [
f"-DPYBIND_OUTPUT_LIBDIR={extdir}{os.sep}{ext.name}{os.sep}",
f"-DPYBIND_OUTPUT_LIBDIR={extdir}{os.sep}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DCMAKE_BUILD_TYPE={cfg}",
f"-DPYTHON_BINDING=ON"
Expand All @@ -49,7 +49,7 @@ def build_extension(self, ext):
build_temp = Path(self.build_temp) / ext.name
if not build_temp.exists():
build_temp.mkdir(parents=True)
lib_path = Path(f"{extdir}{os.sep}{ext.name}{os.sep}")
lib_path = Path(f"{extdir}{os.sep}")
if not lib_path.exists():
lib_path.mkdir(parents=True)

Expand Down

0 comments on commit e4e7836

Please sign in to comment.