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

cython: fix the usage of cython #103

Merged
merged 1 commit into from
Sep 10, 2024
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ ccm start
pytest
```

## Build from source

```bash
pip install build
# optionally can disable the usage of cython
# export CQLSH_NO_CYTHON=true
python -m build -w
...
Successfully built scylla_cqlsh-6.0.24.dev0+gb09bc79361.d20240910-py3-none-any.whl
```

## Creation of the repo

Expand Down
24 changes: 3 additions & 21 deletions pylib/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.


import sys
import os
import warnings
from distutils.core import setup, Extension
from setuptools.command.build_ext import build_ext


class BuildExtCommand(build_ext):
user_options = build_ext.user_options + [
('disable-copyutil=', None, None), # a 'flag' option
]

def initialize_options(self):
self.disable_copyutil = None
super().initialize_options()

def finalize_options(self, *args, **kwargs):
super().finalize_options(*args, **kwargs)
if not self.disable_copyutil:
self.extensions = []


def get_extensions():
if os.environ.get('CQLSH_NO_CYTHON'):
return []
try:
from Cython.Build import cythonize
extensions = [Extension(name='copyutil',
Expand All @@ -63,7 +48,4 @@ def get_extensions():
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
],
cmdclass={
'build_ext': BuildExtCommand,
}
)
2 changes: 1 addition & 1 deletion reloc/build_reloc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fi

python3 -m pip install ${PIP_EXTRA_OPTS} shiv==1.0.6 build==0.10.0 wheel==0.37.1 -t ./build/cqlsh_build

PYTHONPATH=$(pwd)/build/cqlsh_build python3 -m shiv -c cqlsh -o bin/cqlsh -- . -c requirements.txt --config-settings=--disable-copyutil=true
CQLSH_NO_CYTHON=true PYTHONPATH=$(pwd)/build/cqlsh_build python3 -m shiv -c cqlsh -o bin/cqlsh -- . -c requirements.txt

dist/debian/debian_files_gen.py
scripts/create-relocatable-package.py --version $VERSION "$DEST"
Loading