Skip to content

Commit 536fff8

Browse files
committed
Merge branch 'feature/upgrade-setuptools' into develop
[SVCS-140] Closes: #301, #248
2 parents 936f762 + 27c3c8b commit 536fff8

File tree

13 files changed

+43
-35
lines changed

13 files changed

+43
-35
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ before_install:
1515

1616
install:
1717
- travis_retry pip install --upgrade pip
18-
- travis_retry pip install setuptools==30.4.0
18+
- travis_retry pip install setuptools==37.0.0
1919
- travis_retry pip install wheel==0.26.0
2020
- travis_retry pip install invoke==0.13.0
2121
- travis_retry invoke wheelhouse --develop

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ RUN usermod -d /home www-data \
4343
curl \
4444
&& rm -rf /var/lib/apt/lists/* \
4545
&& pip install -U pip \
46-
&& pip uninstall -y setuptools \
47-
&& rm -f /usr/local/lib/python3.5/site-packages/mfr-nspkg.pth \
48-
&& pip install setuptools==30.4.0 \
46+
&& pip install setuptools==37.0.0 \
4947
&& mkdir -p /code
5048

5149
ENV LIBREOFFICE_VERSION 6.0.1.1

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ After installing python3.5, create the virtual environment with the following co
4141
pip install virtualenv
4242
pip install virtualenvwrapper
4343
mkvirtualenv --python=`which python3.5` mfr
44-
pip install setuptools==30.4.0
44+
45+
pip install setuptools==37.0.0
4546
pip install invoke==0.13.0
47+
4648
invoke install
4749
invoke server
4850
```
@@ -86,8 +88,7 @@ invoke test
8688

8789
### Known issues
8890

89-
- Running `invoke install -d` with setuptools v31 or greater can break MFR. The symptom error message is: `"AttributeError: module 'mfr' has no attribute '__version__'".` If you encounter this, you will need to remove the file
90-
`mfr-nspkg.pth` from your virtualenv directory, run `pip install setuptools==30.4.0`, then re-run `invoke install -d`.
91+
- **Updated, 2018-03-01:** *MFR has been updated to work with setuptools==37.0.0 as of MFR release v0.25. The following issue should not happen for new installs, but may occur if you downgrade to an older version.* Running `invoke install -d` with setuptools v31 or greater can break MFR. The symptom error message is: `"AttributeError: module 'mfr' has no attribute '__version__'".` If you encounter this, you will need to remove the file `mfr-nspkg.pth` from your virtualenv directory, run `pip install setuptools==30.4.0`, then re-run `invoke install -d`.
9192

9293
- The error `def create_default_context(purpose=ssl.Purpose.SERVER_AUTH, *, cafile=None, capath=None, cadata=None): SyntaxError: invalid syntax` is caused by inadvertently running the wrong version of Python. This can be caused by hashing the alias `inv`. To fix this run the command `hash -d inv` then run `inv server`.
9394

docs/conf.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# mfr documentation build configuration file.
3+
# MFR documentation build configuration file.
44
#
5-
# This file is execfile()d with the current directory set to its containing dir.
5+
# This file is generated by execfile() with the current directory set to its
6+
# containing dir.
67
#
7-
# Note that not all possible configuration values are present in this
8-
# autogenerated file.
8+
# Note that not all possible configuration values are present in this auto-
9+
# generated file.
910
#
1011
# All configuration values have a default; values that are commented out
1112
# serve to show the default.
1213

1314
import sys
1415
import os
1516

17+
from mfr.version import __version__
18+
1619
# If extensions (or modules to document with autodoc) are in another directory,
1720
# add these directories to sys.path here. If the directory is relative to the
1821
# documentation root, use os.path.abspath to make it absolute, like shown here.
1922
sys.path.insert(0, os.path.abspath('..'))
20-
import mfr # noqa
2123
sys.path.append(os.path.abspath("_themes"))
2224

2325
# -- General configuration -----------------------------------------------------
@@ -52,7 +54,7 @@
5254
# built documents.
5355
#
5456
# The short X.Y version.
55-
version = release = mfr.__version__
57+
version = release = __version__
5658

5759
# The language for content autogenerated by Sphinx. Refer to documentation
5860
# for a list of supported languages.

docs/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Install the versions of ``setuptools`` and ``invoke`` found in the requirements.
2020

2121
.. code-block:: bash
2222
23-
pip install setuptools==30.4.0
23+
pip install setuptools==37.0.0
2424
pip install invoke==0.13.0
2525
2626
Install requirements:

mfr/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
__version__ = '0.24.2'
1+
# This is a namespace package, don't put any functional code in here besides the
2+
# declare_namespace call, or it will disappear on install. See:
3+
# https://setuptools.readthedocs.io/en/latest/setuptools.html#namespace-packages
24
__import__('pkg_resources').declare_namespace(__name__)

mfr/core/remote_logging.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
import logging
44

55
import aiohttp
6-
# from geoip import geolite2
76

8-
import mfr
97
from mfr.server import settings
10-
11-
# import waterbutler
8+
from mfr.version import __version__
129
from waterbutler.core.utils import async_retry
1310

1411

@@ -22,8 +19,7 @@ async def log_analytics(request, metrics, is_error=False):
2219

2320
keen_payload = copy.deepcopy(metrics)
2421
keen_payload['meta'] = {
25-
'mfr_version': mfr.__version__,
26-
# 'wb_version': waterbutler.__version__,
22+
'mfr_version': __version__,
2723
'epoch': 1,
2824
}
2925
keen_payload.update(request)

mfr/server/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import signal
22
import asyncio
3+
import logging
34
from functools import partial
45

56
import tornado.web
67
import tornado.httpserver
78
import tornado.platform.asyncio
8-
import logging
9-
109
from raven.contrib.tornado import AsyncSentryClient
1110

12-
import mfr
1311
from mfr import settings
1412
from mfr.server import settings as server_settings
1513
from mfr.server.handlers.export import ExportHandler
@@ -18,6 +16,7 @@
1816
from mfr.server.handlers.exporters import ExportersHandler
1917
from mfr.server.handlers.renderers import RenderersHandler
2018
from mfr.server.handlers.core import ExtensionsStaticFileHandler
19+
from mfr.version import __version__
2120

2221
logger = logging.getLogger(__name__)
2322

@@ -33,6 +32,7 @@ def stop_loop():
3332

3433
io_loop.add_callback_from_signal(stop_loop)
3534

35+
3636
def make_app(debug):
3737
app = tornado.web.Application(
3838
[
@@ -46,7 +46,7 @@ def make_app(debug):
4646
],
4747
debug=debug,
4848
)
49-
app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=mfr.__version__)
49+
app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=__version__)
5050
return app
5151

5252

mfr/server/handlers/status.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import tornado.web
22

3-
import mfr
3+
from mfr.version import __version__
4+
45

56
class StatusHandler(tornado.web.RequestHandler):
67

78
def get(self):
89
"""List information about modular-file-renderer status"""
910
self.write({
1011
'status': 'up',
11-
'version': mfr.__version__
12+
'version': __version__
1213
})

mfr/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.24.2'

0 commit comments

Comments
 (0)