Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyFastANI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Larralde
PyFastANI
Commits
49e21e2a
Commit
49e21e2a
authored
3 years ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Fix compilation error with `clang` on some older OSX versions
parent
62cb5c9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.github/workflows/package.yml
+2
-6
2 additions, 6 deletions
.github/workflows/package.yml
.github/workflows/test.yml
+2
-2
2 additions, 2 deletions
.github/workflows/test.yml
setup.cfg
+1
-0
1 addition, 0 deletions
setup.cfg
setup.py
+29
-0
29 additions, 0 deletions
setup.py
with
34 additions
and
8 deletions
.github/workflows/package.yml
+
2
−
6
View file @
49e21e2a
...
...
@@ -76,9 +76,7 @@ jobs:
run
:
python -m pip install --no-index --find-links=dist pyfastani
-
name
:
Install numpy
run
:
python -m pip install numpy
if
:
${{ !startsWith(matrix.python-version != 'pypy' }}
-
name
:
Install tests requirements
run
:
python -m pip install -r pyfastani/tests/requirements.txt
if
:
${{ !startsWith(matrix.python-version, 'pypy') }}
-
name
:
Run tests without coverage
run
:
python -m unittest pyfastani.tests -vv
...
...
@@ -144,9 +142,7 @@ jobs:
run
:
python -m pip install --no-index --find-links=dist pyfastani
-
name
:
Install numpy
run
:
python -m pip install numpy
if
:
${{ !startsWith(matrix.python-version != 'pypy' }}
-
name
:
Install tests requirements
run
:
python -m pip install -r pyfastani/tests/requirements.txt
if
:
${{ !startsWith(matrix.python-version, 'pypy') }}
-
name
:
Run tests without coverage
run
:
python -m unittest pyfastani.tests -vv
...
...
This diff is collapsed.
Click to expand it.
.github/workflows/test.yml
+
2
−
2
View file @
49e21e2a
...
...
@@ -66,7 +66,7 @@ jobs:
run
:
python setup.py build_ext --inplace --debug
-
name
:
Install numpy
run
:
python -m pip install numpy
if
:
${{ !startsWith(matrix.python-version
!=
'pypy' }}
if
:
${{ !startsWith(matrix.python-version
,
'pypy'
)
}}
-
name
:
Install tests requirements
run
:
python -m pip install -r pyfastani/tests/requirements.txt
-
name
:
Test with coverage
...
...
@@ -138,7 +138,7 @@ jobs:
-
name
:
Build C extension
run
:
python setup.py build_ext --inplace --debug
-
name
:
Install numpy
if
:
${{ matrix.python-
impl != 'PyP
y' }}
if
:
${{
!startsWith(
matrix.python-
version, 'pyp
y'
)
}}
run
:
python -m pip install numpy
-
name
:
Install tests requirements
run
:
python -m pip install -r pyfastani/tests/requirements.txt
...
...
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
0
View file @
49e21e2a
...
...
@@ -52,6 +52,7 @@ setup_requires =
[options.package_data]
pyfastani
= py.typed,
*
.pyi
pyfastani.tests
= requirements.txt
[publicize_headers]
sources
= vendor/FastANI/src
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
29
−
0
View file @
49e21e2a
...
...
@@ -112,6 +112,30 @@ class build_ext(_build_ext):
"""
A `build_ext` that disables optimizations if compiled in debug mode.
"""
# --- Autotools-like helpers ---
def
_silent_spawn
(
self
,
cmd
):
try
:
subprocess
.
run
(
cmd
,
check
=
True
,
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
PIPE
)
except
subprocess
.
CalledProcessError
as
err
:
raise
CompileError
(
err
.
stderr
)
def
_needs_clang_flags
(
self
):
self
.
mkpath
(
self
.
build_temp
)
testfile
=
os
.
path
.
join
(
self
.
build_temp
,
"
testc++11.cpp
"
)
with
open
(
testfile
,
"
w
"
)
as
f
:
f
.
write
(
'
#include <chrono>
\n
'
)
try
:
with
mock
.
patch
.
object
(
self
.
compiler
,
"
spawn
"
,
new
=
self
.
_silent_spawn
):
objects
=
self
.
compiler
.
compile
([
testfile
],
debug
=
self
.
debug
)
except
CompileError
as
err
:
log
.
warn
(
'
failed to include <chrono>, assuming we need clang flags
'
)
return
True
else
:
log
.
info
(
'
successfully built a C++11 program with default flags
'
)
return
False
def
finalize_options
(
self
):
_build_ext
.
finalize_options
(
self
)
self
.
_clib_cmd
=
self
.
get_finalized_command
(
"
build_clib
"
)
...
...
@@ -179,6 +203,11 @@ class build_ext(_build_ext):
ext
.
extra_compile_args
.
append
(
"
-std=c++11
"
)
ext
.
extra_link_args
.
append
(
"
-std=c++11
"
)
# in case we are compiling with clang, make sure to use libstdc++
if
self
.
compiler
.
compiler_type
==
"
unix
"
and
sys
.
platform
==
"
darwin
"
:
ext
.
extra_compile_args
.
append
(
"
-stdlib=libc++
"
)
ext
.
extra_link_args
.
append
(
"
-stdlib=libc++
"
)
# build the rest of the extension as normal
_build_ext
.
build_extension
(
self
,
ext
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment