Commit b7a93b6d authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

remove old code

parent 9af47116
include README.rst CHANGELOG LICENSE buildout.cfg requirements.txt version.txt
include test-requirements.txt
recursive-include doc doc/plot *.rst *.png conf.py *.py *.ico
recursive-include doc *.rst *.png conf.py *.py *.ico
......@@ -47,22 +47,7 @@ add/remove its name in appropriate places.
Releasing a new version of Bob
------------------------------
Please run::
$ # prepare a development environment for this package
$ buildout
$ bin/python ./bob/script/get_versions.py requirements.txt > requirements.txt
This will give you the latest tag version of public packages release on PyPI.
* Find the same latest tag information of private packages using Gitlab tags.
For private packages you cannot use the ``get_versions.py`` script.
* Update private-requirements.txt similar to requirements.txt
* Put the same tags in ``conda/meta.yaml`` too. You need to pin like this:
``bob.extension 2.4.5``.
* Tag and push.
* Remove the pins again to relax the dependencies while in master.
Use the release script from bob.admin to do this.
.. External References
......
# Andre Anjos <andre.anjos@idiap.ch>
# Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
# Amir Mohammadi <amir.mohammadi@idipa.ch>
# Mon 20 Jul 17:30:00 CEST 2015
# Lists the final version of a given package in PyPI
import pkg_resources # for bob import to work properly
import sys
import os
def main():
from bob.utils import get_releases, get_max_version
if len(sys.argv) != 2:
print("usage: %s <requirements.txt>" % os.path.basename(sys.argv[0]))
sys.exit(1)
dependencies = [l.rstrip("\n") for l in open(sys.argv[1], 'r').readlines()]
for d in dependencies:
d = d.split("==")[0].strip()
versions = get_releases(d)
print("{0} == {1}".format(
d, '{}.{}.{}'.format(*get_max_version(versions).version)))
if __name__ == '__main__':
main()
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
# Wed 05 Aug 11:36 2015 CEST
#
# Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
import distutils.version
import pkg_resources
import re
import requests
def get_config():
"""
Returns a string containing the configuration information.
"""
import bob.extension
return bob.extension.get_config(__name__)
def get_releases(package):
"""
Given a package name, get the release versions
"""
url = "https://pypi.org/pypi/{}/json".format(package)
return requests.get(url).json()["releases"]
def get_max_version(versions):
try:
v = list(reversed(sorted([distutils.version.StrictVersion(k)
for k in versions])))
final = [k for k in v if not k.prerelease]
if final:
return final[0]
return v[0]
except Exception:
v = list(reversed(sorted([distutils.version.LooseVersion(k)
for k in versions])))
final = [k for k in v if not re.search(r'[a-z]', k.vstring)]
if final:
return final[0]
return v[0]
def get_dependencies(pkg_name="bob"):
"""
Given a package name, get the dependency list
"""
package = pkg_resources.working_set.by_key[pkg_name]
return [str(r) for r in package.requires()]
; vim: set fileencoding=utf-8 :
; Wed Apr 4 15:29:11 CEST 2018
; Tue Apr 17 13:50:43 CEST 2018
[buildout]
parts = scripts
develop = .
eggs = envs
eggs = bob
extensions = bob.buildout
newest = false
verbose = true
......
Supports Markdown
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