Commit b6ed357f authored by Sean Leavey's avatar Sean Leavey
Browse files

Fix makefile

parent e47c4b6d
......@@ -87,10 +87,7 @@ build/linux/conda:
stage: build
image: igwn/base:conda
script:
- apt update
- apt install -y build-essential
# Create the environment using the definition file and store it locally so we can
# pass it to other jobs.
# Create the environment using the definition file.
- conda env create -f environment.yml -p .finesse-env
- source activate ./.finesse-env # Needs to be "source", not "conda".
- python --version
......
# Detect number of threads to build with.
ifndef CPU_COUNT
OS = $(shell uname -s)
ifeq ($(OS), Linux)
NUM_THREADS = $(shell grep -c ^processor /proc/cpuinfo)
else ifeq ($(OS), Darwin)
NUM_THREADS = $(shell system_profiler | awk '/Number of CPUs/ {print $$4}{next;}')
else
NUM_THREADS = 1
endif
else
# Override detected count with CPU_COUNT environment variable if exists.
override NUM_THREADS = $(CPU_COUNT)
endif
BUILD_CMD = python setup.py build_ext -j $(NUM_THREADS) --inplace
default:
python3 setup.py build_ext -j 4 --inplace
$(BUILD_CMD)
debug:
CYTHON_DEBUG=1 python3 setup.py build_ext -j 4 --inplace
CYTHON_DEBUG=1 $(BUILD_CMD)
# Build Cython extensions with the CYTHON_TRACE flag enabled to allow coverage tracking.
coverage:
CYTHON_COVERAGE=1 python3 setup.py build_ext -j 4 --force --inplace
CYTHON_COVERAGE=1 $(BUILD_CMD)
clean:
find . -name "*.so" -type f -delete
......
......@@ -83,7 +83,7 @@ sections later on.
5. Install the project with developer dependencies using a Python packaging tool such as
`pip <https://pip.pypa.io/en/stable/installing/>`__::
pip install -e .[test,docs,lint]
pip install -e .[test,docs,dev]
6. Install the pre-commit hooks that will check your code for style errors when you
commit::
......
......@@ -11,4 +11,4 @@ dependencies:
- pip:
# Can run arbitrary pip commands here; see e.g.
# https://stackoverflow.com/a/59056234/2251982.
- -e .[test,docs,lint]
- -e .[test,docs,dev]
......@@ -12,4 +12,4 @@ dependencies:
- pip:
# Can run arbitrary pip commands here; see e.g.
# https://stackoverflow.com/a/59056234/2251982.
- -e .[test,docs,lint]
- -e .[test,docs,dev]
[build-system]
# Numpy requirement should match that in setup.cfg install_requires.
# Numpy and Cython requirements should match that in setup.cfg install_requires and
# extra_requires, respectively.
requires = ["setuptools", "wheel", "setuptools_scm[toml]", "Cython", "numpy == 1.20.3"]
build-backend = "setuptools.build_meta"
......
......@@ -83,7 +83,8 @@ docs =
jupyter-sphinx
numpydoc
reslate
lint =
dev =
cython # Only required for `make`, which builds without isolation.
black
pre-commit
pylint
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment