Read about our upcoming Code of Conduct on this issue

Commit e52a4ca7 authored by Pierre Augier's avatar Pierre Augier
Browse files

Add dist package (0.0.5)

parent f3857b43b7f2
0.0.5 (2018-10-14)
------------------
- Add a dist package
......@@ -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
-------
......
__version__ = "0.0.4"
__version__ = "0.0.5"
try:
from pyfiglet import figlet_format
......
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",
]
import logging
logger = logging.getLogger("pythran")
logger = logging.getLogger("fluidpythran")
# 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):
......
[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 =
......
......@@ -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:
......
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