Skip to content

Commit

Permalink
[REVISION] increase version just for Pypi compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-Curti committed Aug 20, 2020
1 parent 614f0e5 commit f0ffad3
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 11 deletions.
98 changes: 98 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,101 @@
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
./lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/


# Prerequisites
*.d

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.9.0)
# rFBP Version
set (RFBP_MAJOR 1)
set (RFBP_MINOR 0)
set (RFBP_REVISION 0)
set (RFBP_REVISION 1)
set (RFBP_VERSION ${RFBP_MAJOR}.${RFBP_MINOR}.${RFBP_REVISION})

project (rFBP LANGUAGES CXX VERSION ${RFBP_VERSION} DESCRIPTION "Replicated Focusing Belief Propagation")
Expand Down
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
include *.md
include *.txt
include *.yml
include include/*
include hpp/*
include ReplicatedFocusingBeliefPropagation/*.json
include ReplicatedFocusingBeliefPropagation/lib/*.pxd
include ReplicatedFocusingBeliefPropagation/lib/*.hpp
include ReplicatedFocusingBeliefPropagation/source/*.pyx
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ you can compile the main example and the `C++` library.

Python version supported : ![Python version](https://img.shields.io/badge/python-3.5|3.6|3.7|3.8-blue.svg)

The easiest way to install the package is to use `pip`

```bash
python -m pip install ReplicatedFocusingBeliefPropagation
```

The `Python` installation can be performed with or without the `C++` installation.
The `Python` installation is always executed using [`setup.py`](https://github.com/Nico-Curti/blob/master/setup.py) script.

Expand Down
34 changes: 33 additions & 1 deletion ReplicatedFocusingBeliefPropagation/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"./src/spline.cpp",
"./src/utils.cpp"
],
"dependencies": ["./include/atanherf.h",
"./include/spline.h",
"./include/utils.h",
"./hpp/utils.hpp"
],
"include_dirs": [ "./ReplicatedFocusingBeliefPropagation/lib/",
"./hpp/",
"./include/"
Expand All @@ -17,6 +22,11 @@
"./src/fprotocol.cpp",
"./src/utils.cpp"
],
"dependencies": ["./include/fprotocol.h",
"./include/utils.h",
"./ReplicatedFocusingBeliefPropagation/lib/misc.hpp",
"./hpp/utils.hpp"
],
"include_dirs": [ "./ReplicatedFocusingBeliefPropagation/lib/",
"./hpp/",
"./include/"
Expand All @@ -29,6 +39,11 @@
"./src/pattern.cpp",
"./src/utils.cpp"
],
"dependencies": ["./include/pattern.h",
"./include/utils.h",
"./ReplicatedFocusingBeliefPropagation/lib/misc.hpp",
"./hpp/utils.hpp"
],
"include_dirs": [ "./ReplicatedFocusingBeliefPropagation/lib/",
"./hpp/",
"./include/"
Expand All @@ -48,10 +63,27 @@
"./src/spline.cpp",
"./src/utils.cpp"
],
"dependencies": ["./include/rfbp.h",
"./include/atanherf.h",
"./include/cavity_message.h",
"./include/fprotocol.h",
"./include/magnetization.h",
"./include/params.h",
"./include/pattern.h",
"./include/spline.h",
"./include/utils.h",
"./ReplicatedFocusingBeliefPropagation/lib/misc.hpp",
"./hpp/cavity_message.hpp",
"./hpp/magnetization.hpp",
"./hpp/params.hpp",
"./hpp/pattern.hpp",
"./hpp/rfbp.hpp",
"./hpp/utils.hpp"
],
"include_dirs": [ "./ReplicatedFocusingBeliefPropagation/lib/",
"./hpp/",
"./include/"
],
"libraries": []
}
}
}
2 changes: 1 addition & 1 deletion docs/python_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ or for installing in development mode:
python setup.py develop --user
```

### Installation using pip (Untested)
### Installation using pip

The latest release of the `rFBP` package can be installed using `pip`

Expand Down
2 changes: 1 addition & 1 deletion scorer
Submodule scorer updated 3 files
+3 −0 MANIFEST.in
+2 −0 setup.cfg
+25 −11 setup.py
28 changes: 21 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function

import os
import sys
import json
Expand All @@ -22,6 +20,8 @@
from distutils import sysconfig
from Cython.Distutils import build_ext
from distutils.sysconfig import customize_compiler
from distutils.command.sdist import sdist as _sdist


def get_requires (requirements_filename):
'''
Expand Down Expand Up @@ -90,6 +90,12 @@ def build_extensions (self):
build_ext.build_extensions(self)


class sdist(_sdist):
def run(self):
self.run_command("build_ext")
_sdist.run(self)


def read_description (readme_filename):
'''
Description package from filename
Expand All @@ -115,11 +121,11 @@ def read_description (readme_filename):
return ''


def read_dependecies_build (dependecies_filename):
def read_dependencies_build (dependencies_filename):
'''
Read the json of dependencies
'''
with open(dependecies_filename, 'r') as fp:
with open(dependencies_filename, 'r') as fp:
dependecies = json.load(fp)

return dependecies
Expand All @@ -139,7 +145,7 @@ def read_dependecies_build (dependecies_filename):
CPP_COMPILER = platform.python_compiler()
README_FILENAME = os.path.join(here, 'README.md')
REQUIREMENTS_FILENAME = os.path.join(here, 'requirements.txt')
DEPENDECIES_FILENAME = os.path.join(here, 'ReplicatedFocusingBeliefPropagation', 'dependencies.json')
DEPENDENCIES_FILENAME = os.path.join(here, 'ReplicatedFocusingBeliefPropagation', 'dependencies.json')
VERSION_FILENAME = os.path.join(here, 'ReplicatedFocusingBeliefPropagation', '__version__.py')

ENABLE_OMP = False
Expand Down Expand Up @@ -174,7 +180,7 @@ def read_dependecies_build (dependecies_filename):
URL = 'https://github.com/Nico-Curti/rFBP/archive/v{}.tar.gz'.format(about['__version__'])

# Read dependecies graph
dependencies = read_dependecies_build(DEPENDECIES_FILENAME)
dependencies = read_dependencies_build(DEPENDENCIES_FILENAME)

# Set compiler variables
define_args = [ '-DMAJOR={}'.format(Version[0]),
Expand Down Expand Up @@ -245,6 +251,10 @@ def read_dependecies_build (dependecies_filename):

whole_compiler_args = sum([cpp_compiler_args, compile_args, define_args, linker_args], [])

cmdclass = {'build_ext': rfbp_build_ext,
'sdist': sdist}


# Where the magic happens:
setup(
name = NAME,
Expand All @@ -261,6 +271,10 @@ def read_dependecies_build (dependecies_filename):
url = URL,
download_url = URL,
keywords = KEYWORDS,
setup_requires = [# Setuptools 18.0 properly handles Cython extensions.
'setuptools>=18.0',
'cython',
'numpy'],
packages = find_packages(include=['ReplicatedFocusingBeliefPropagation',
'ReplicatedFocusingBeliefPropagation.*'],
exclude=('test', 'example')),
Expand All @@ -276,7 +290,7 @@ def read_dependecies_build (dependecies_filename):
'Programming Language :: Python :: Implementation :: PyPy'
],
license = 'MIT',
cmdclass = {'build_ext': rfbp_build_ext},
cmdclass = cmdclass,
ext_modules = [
Extension(name='.'.join(['ReplicatedFocusingBeliefPropagation', 'lib', name]),
sources=values['sources'],
Expand Down

0 comments on commit f0ffad3

Please sign in to comment.