Skip to content

Commit

Permalink
fix problem getting version in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Konrad committed Jul 29, 2020
1 parent dd56232 commit 0462cfd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ lda: Topic modeling with latent Dirichlet allocation
|pypi| |zenodo|

``lda`` implements latent Dirichlet allocation (LDA) using collapsed Gibbs
sampling. ``lda`` is fast and is tested on Linux, OS X, and Windows.
sampling. ``lda`` is fast and is tested on Linux, OS X, and Windows. This is
a maintainance fork of the original code for newer Python versions.

You can read more about lda in `the documentation <https://lda.readthedocs.io>`_.

Expand Down Expand Up @@ -144,7 +145,7 @@ lda is licensed under Version 2.0 of the Mozilla Public License.
.. _Pritchard et al. (2000): http://www.genetics.org/content/155/2/945.full
.. _Griffiths and Steyvers (2004): http://www.pnas.org/content/101/suppl_1/5228.abstract

.. |pypi| image:: https://badge.fury.io/py/lda.png
.. |pypi| image:: https://badge.fury.io/py/ldafork.png
:target: https://pypi.python.org/pypi/ldafork
:alt: pypi version

Expand Down
1 change: 1 addition & 0 deletions build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function repair_wheel {
#git checkout $LAST

PYVERS="36 37 38"
#PYVERS="38"

for v in $PYVERS; do
cd /io
Expand Down
5 changes: 5 additions & 0 deletions doc/source/release_howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ files.

4. Build MacOS and Windows wheels via AppVeyor.

Push the created tag to the repository connected to AppVeyor. This should trigger AppVeyor to build the MacOS
and Windows builds.

The built wheels are pushed to the GitHub releases page. They can be downloaded to the ``dist/`` folder via
``download_releases.py`` (make sure to install the dependencies from ``deploy-requirements.txt`` first).

You may manually upload the generated manylinux wheels to the GitHub release page, too.

5. Upload and sign each wheel

for fn in dist/*.whl; do twine upload -i D5493B3459D0858AB8CE06E44D811ED4C698940F --sign $fn; done
Expand Down
19 changes: 14 additions & 5 deletions download_releases.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# script to download all releases from latest release on GitHub repository page

import os
import requests
from github import Github

REPO = 'WZBSocialScienceCenter/lda'

def download_file(url): # taken from https://stackoverflow.com/a/16696317
local_filename = 'dist/' + url.split('/')[-1]
local_filename = 'dist/' + url.split('/')[-1]

if os.path.exists(local_filename):
return local_filename, False

with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(local_filename, 'wb') as f:
Expand All @@ -15,7 +20,8 @@ def download_file(url): # taken from https://stackoverflow.com/a/16696317
# and set chunk_size parameter to None.
#if chunk:
f.write(chunk)
return local_filename

return local_filename, True


g = Github()
Expand All @@ -25,15 +31,18 @@ def download_file(url): # taken from https://stackoverflow.com/a/16696317
repo = g.get_repo(REPO)
releases = repo.get_releases()

latest_release = list(releases)[-1]
latest_release = list(releases)[0]
print('latest release is', latest_release.tag_name)

assets = latest_release.get_assets() # from latest release

print('downloading assets')
for asset in assets:
print('>', asset.name)
stored_file = download_file(asset.browser_download_url)
print('> downloaded to', stored_file)
stored_file, downloaded = download_file(asset.browser_download_url)
if downloaded:
print('> downloaded to', stored_file)
else:
print('> file already exists:', stored_file)

print('done.')
2 changes: 1 addition & 1 deletion lda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from lda.lda import LDA # noqa
import lda.datasets # noqa

__version__ = pbr.version.VersionInfo('lda').version_string()
__version__ = pbr.version.VersionInfo('ldafork').version_string()

logging.getLogger('lda').addHandler(logging.NullHandler())

0 comments on commit 0462cfd

Please sign in to comment.