You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -62,16 +77,36 @@ After you finish answering the promps, the new project will be made.
62
77
63
78
Local Development Workflow / Hello World
64
79
----------------------------------------
65
-
This depends on you having ``Make``, ``virtualenv``, and the Rust compiler. Get the Rust compiler from Rustup_
80
+
This depends on you having ``virtualenv``, and the Rust compiler. Get the Rust compiler from Rustup_. Linux/macOS
81
+
users will also need ``Make``.
66
82
67
-
I will also mention that the Makefile workflow doesn't quite work on Windows yet, but it's still pretty easy
68
-
to get going. You basically make a virtualenv, install the dev dependencies and run ``python setup.py test|install|bdist_wheel|develop`` depending on what you want to do.
83
+
**Linux/macOS**
69
84
70
-
Still with me? Okay, you are now ready to build your first Rust wheel locally.
71
-
Go into the directory that Cookiecutter just created and perform your first build locally with:
85
+
The entire local process of building and testing (including
86
+
creating and activating a virtualenv) is conducted by a single Make command::
72
87
88
+
# cd to new project. The default name is rust_pypi_example
89
+
cd rust_pypi_example
73
90
make local-test
74
91
92
+
I will note that the virtualenv created by Make seems to have some issues if you try to activate it.
93
+
If you want to work interactivly you should build your own virtualenv and use that instead.
94
+
95
+
**Windows**
96
+
97
+
The Makefile workflow doesn't quite work on Windows yet, but it's still pretty easy
98
+
to get going. You basically make a virtualenv, install the dev dependencies and run ``python setup.py test|install|bdist_wheel|develop`` depending on what you want to do.
99
+
100
+
Go into the directory that Cookiecutter just created (default is rust_pypi_example) and perform your
101
+
first build locally with::
102
+
103
+
# make a virtualenv and activate it
104
+
pip install -U pip
105
+
pip install -r requirements_dev.txt
106
+
python setup.py build_ext # compile ext
107
+
python setup.py test # test
108
+
python setup.py bdist_wheel # to make the wheel. Always build_ext first
109
+
75
110
W00t. You just tested, compiled and packaged you're first Python wheel with a Rust module.
76
111
77
112
.. _Rustup: https://www.rustup.rs/
@@ -92,6 +127,22 @@ Set Up Cross-Platform CI, Build and Release
92
127
93
128
.. _`pip docs for requirements files`: https://pip.pypa.io/en/stable/user_guide/#requirements-files
94
129
130
+
Known Bugs
131
+
----------
132
+
If you don't run **build_ext** before **bdist_wheel**, the resulting wheel will not have the shared library
133
+
compiled by Cargo. In other words::
134
+
135
+
# This alone will make a defective wheel
136
+
python setup.py bdist_wheel
137
+
138
+
# this will work
139
+
python setup.py build_ext
140
+
python setup.py bdist_wheel
141
+
142
+
TODOs
143
+
-----
144
+
145
+
[ ] source distributions.
95
146
96
147
For more details, see the `cookiecutter-pypackage tutorial`_.
0 commit comments