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

Restored this accidentally-deleted pull request #1307

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ MOD_SRC = src/modules/src
bindings_python build/cffirmware.py: bindings/setup.py $(MOD_SRC)/*.c
swig -python -I$(MOD_INC) -Isrc/hal/interface -Isrc/utils/interface -Isrc/modules/interface/controller -o build/cffirmware_wrap.c bindings/cffirmware.i
$(PYTHON) bindings/setup.py build_ext --inplace
cp cffirmware_setup.py build/setup.py

test_python: build/cffirmware.py
PYTHONPATH=build $(PYTHON) -m pytest test_python
Expand Down
36 changes: 36 additions & 0 deletions cffirmware_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Distutils setup file for Crazyflie Python firmware bindings
#
# Automatically copied to build/ directory when you run
#
# make bindings_python
#
# Then you can cd to build/ and do
#
# sudo python3 setup.py install
#
# Copyright (C) 2023 Bitcraze AB and Simon D. Levy
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from distutils.core import setup

setup(
name='cffirmware',
version='0.1',
packages=[''],
package_dir={'': '.'},
package_data={'': ['_cffirmware.cpython-38-x86_64-linux-gnu.so']},
)
3 changes: 2 additions & 1 deletion docs/building-and-flashing/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ First make sure that you have [SWIG](https://swig.org/) installed on your system
```bash
make cf2_defconfig
make bindings_python
cd build
python3 setup.py install --user
```


## Make targets

### General targets
Expand Down