Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fluiddyn
transonic
Commits
1a23877d2e1a
Commit
e52a4ca7
authored
Oct 14, 2018
by
Pierre Augier
Browse files
Add dist package (0.0.5)
parent
f3857b43b7f2
Changes
7
Hide whitespace changes
Inline
Side-by-side
CHANGES.rst
0 → 100644
View file @
1a23877d
0.0.5 (2018-10-14)
------------------
- Add a dist package
README.rst
View file @
1a23877d
...
...
@@ -202,7 +202,7 @@ setup.py like this:
from
pathlib
import
Path
from fluidpythran.
files_maker
import make_pythran_files
from
fluidpythran
.
dist
import
make_pythran_files
here
=
Path
(
__file__
).
parent
.
absolute
()
...
...
@@ -210,8 +210,11 @@ setup.py like this:
make_pythran_files
([
here
/
path
for
path
in
paths
])
Note
that
FluidPythran
never
uses
Pythran
.
Compiling
the
associated
Pythran
file can be done if wanted (see for example how it is done in `fluidsim's
setup.py <https://bitbucket.org/fluiddyn/fluidsim/src/default/setup.py>`_).
file
can
be
done
if
wanted
(
see
for
example
how
it
is
done
in
the
example
package
`
example_package_fluidpythran
<
https
://
bitbucket
.
org
/
fluiddyn
/
example_package_fluidpythran
>`
_
or
in
`
fluidsim
's setup.py
<https://bitbucket.org/fluiddyn/fluidsim/src/default/setup.py>`_).
License
-------
...
...
fluidpythran/_version.py
View file @
1a23877d
__version__
=
"0.0.
4
"
__version__
=
"0.0.
5
"
try
:
from
pyfiglet
import
figlet_format
...
...
fluidpythran/dist.py
0 → 100644
View file @
1a23877d
import
os
from
datetime
import
datetime
from
pathlib
import
Path
from
distutils.command.build_ext
import
build_ext
from
.files_maker
import
make_pythran_files
try
:
from
pythran.dist
import
PythranBuildExt
,
PythranExtension
can_import_pythran
=
True
except
ImportError
:
can_import_pythran
=
False
PythranBuildExt
=
build_ext
PythranExtension
=
None
def
modification_date
(
file_path
):
return
datetime
.
fromtimestamp
(
os
.
path
.
getmtime
(
file_path
))
def
detect_pythran_extensions
(
name_package
):
if
not
can_import_pythran
:
return
[]
ext_names
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
name_package
):
path_dir
=
Path
(
root
)
for
name
in
files
:
if
(
name
.
endswith
(
"_pythran.py"
)
or
path_dir
.
name
==
"_pythran"
and
name
.
endswith
(
".py"
)
):
path
=
path_dir
/
name
ext_names
.
append
(
str
(
path
).
replace
(
os
.
path
.
sep
,
"."
).
split
(
".py"
)[
0
]
)
return
ext_names
__all__
=
[
"make_pythran_files"
,
"PythranBuildExt"
,
"PythranExtension"
,
"can_import_pythran"
,
"detect_pythran_extensions"
,
]
fluidpythran/log.py
View file @
1a23877d
import
logging
logger
=
logging
.
getLogger
(
"pythran"
)
logger
=
logging
.
getLogger
(
"
fluid
pythran"
)
# Initialize logging
try
:
...
...
@@ -23,7 +23,7 @@ try:
except
ImportError
:
# No color available, use default config
logging
.
basicConfig
(
format
=
"%(levelname)s: %(message)s"
)
logger
.
warn
(
"Disabling color, you really want to install colorlog."
)
logger
.
info
(
"Disabling color, you really want to install colorlog."
)
def
set_log_level
(
level
):
...
...
setup.cfg
View file @
1a23877d
[metadata]
name = fluidpythran
description = Pythran annotations in Python files
long_description = file: README.rst
, LICENSE.txt
long_description = file: README.rst
keywords = pythran
license = CeCILL-B License
classifiers =
...
...
setup.py
View file @
1a23877d
...
...
@@ -4,14 +4,14 @@ from pathlib import Path
f
"In >=2018, you should use a Python supporting f-strings!"
d
=
run_path
(
"fluidpythran/_version.py"
)
here
=
Path
(
__file__
).
parent
.
absolute
()
d
=
run_path
(
here
/
"fluidpythran/_version.py"
)
__version__
=
d
[
"__version__"
]
__about__
=
d
[
"__about__"
]
print
(
__about__
)
here
=
Path
(
__file__
).
parent
.
absolute
()
path_data_tests
=
here
/
"data_tests"
if
path_data_tests
.
exists
():
with
open
(
"fluidpythran/_path_data_tests.py"
,
"w"
)
as
file
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment