CoronaWhy / task-geo

"Help us understand how geography affects virality."
MIT License
10 stars 20 forks source link

Fix Makefile for MacOS #38

Closed ilovechai closed 4 years ago

ilovechai commented 4 years ago

Description

Fixes:

Checklist:

awalther commented 4 years ago

@cryptox31 I just ran most what's in the Makefile on my local setup (OS X High Sierra 10.13.4), installing, testing, and linting works, but creating docs gives me the following error:


# Python version: 3.7.0 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/Users/alexwalther/.pyenv/versions/task_geo/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/Users/alexwalther/.pyenv/versions/task_geo/lib/python3.7/site-packages/sphinx/application.py", line 244, in __init__
    self.setup_extension(extension)
  File "/Users/alexwalther/.pyenv/versions/task_geo/lib/python3.7/site-packages/sphinx/application.py", line 398, in setup_extension
    self.registry.load_extension(self, extname)
  File "/Users/alexwalther/.pyenv/versions/task_geo/lib/python3.7/site-packages/sphinx/registry.py", line 414, in load_extension
    metadata = setup(app)
  File "/Users/alexwalther/.pyenv/versions/task_geo/lib/python3.7/site-packages/m2r.py", line 652, in setup
    app.add_source_parser('.md', M2RParser)
  File "/Users/alexwalther/.pyenv/versions/task_geo/lib/python3.7/site-packages/sphinx/application.py", line 1069, in add_source_parser
    self.registry.add_source_parser(*args, **kwargs)
TypeError: add_source_parser() takes 2 positional arguments but 3 were given```
ilovechai commented 4 years ago

@awalther I am not sure about the error you're getting. I have only change the version of python that should be used. I have python2 and python3, and so I wanted only python3 to be used, since in the documentation it says python3 and above should be used.

I am on MacOS Catalina and for some reason even after

make install-develop

running the below command did not work for me

➜  task-geo git:(cryptox31/fix/makefile) ✗ make docs
rm -f docs/api/*.rst
/Library/Developer/CommandLineTools/usr/bin/make -C docs clean 2>/dev/null  # this fails if sphinx is not yet installed
sphinx-apidoc --separate --no-toc -o docs/api/ task_geo
Creating file docs/api/task_geo.rst.
Creating file docs/api/task_geo.data_sources.rst.
Creating file docs/api/task_geo.data_sources.noaa.rst.
Creating file docs/api/task_geo.data_sources.noaa.api_connector.rst.
Creating file docs/api/task_geo.data_sources.noaa.api_formatter.rst.
Creating file docs/api/task_geo.data_sources.noaa.ftp_connector.rst.
Creating file docs/api/task_geo.data_sources.noaa.references.rst.
/Library/Developer/CommandLineTools/usr/bin/make -C docs html
Running Sphinx v2.2.0

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.7/site-packages/sphinx/config.py", line 361, in eval_config_file
    execfile_(filename, namespace)
  File "/opt/anaconda3/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/Users/../CoronaWhy/task-geo/docs/conf.py", line 23, in <module>
    import task_geo
ModuleNotFoundError: No module named 'task_geo'

make[1]: *** [html] Error 2
make: *** [docs] Error 2
ManuelAlvarezC commented 4 years ago

Ok guys, I'm closing this PR for now.

@cryptox31 A couple of things:

  1. While we deeply appreciate your effort and iniciative, please, before opening a PR, open a bug report, let us check we are able to replicate the error, so we know that the issue is on the codebase, not only on your local machine, and then we can fix it and open a PR. This will save all of us lots of vain efforts.

  2. The changes of python to python3 are redundant as if you are using a virtualenv, which you should be using, the following commands will yield the same result:

which python
which python3

And in both cases will be the one from your virtualenv.

3. I opened an issue and copied your discussion there. Please check everything is in order and continue the discussion there.