Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Makefile based boilerplate for python projects #1756

Merged
merged 9 commits into from Dec 10, 2019

Conversation

@return42
Copy link
Collaborator

return42 commented Nov 28, 2019

This PR adds a boilerplate for shorter development cycles. Its build from a subset of makefiles I used since years / boilerplate.

I really like to have such handy make targets and the smooth emacs integration, hope other see the benefit also ..

BTW: this series starts with a bugfix of setup.py, which is not special to this PR

return42 added 8 commits Nov 28, 2019
setup(..) named arguments 'install_requires' and 'extras_require' need lists
arguments, the <map object> is ignored when installing extra environment
'test'::

  pip install -e .\[test\]

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Add *Makefile* boilerplate useful for python projects.  All python tasks are
using a virtualenv from ./local/py3

$ make help
  run       - run developer instance
  install   - developer install (./local)
  uninstall - uninstall (./local)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The .dir-locals.el set the project's python enviroment for the emacs tasks like
flycheck or jedi.  The py-environment has to be next to <repo>/.dir-locals.el::

    ./local/py3

To setup such an environment build target 'pyenv' or 'pyenvinstall'::

  $ make pyenvinstall

TL;DR

Alternatively create the virtualenv, source it and install jedi + epc
(required by `emacs-jedi <https://tkf.github.io/emacs-jedi>`_)::

    $ virtualenv --python=python3  "--no-site-packages" ./local/py3
    ...
    $ source ./local/py3/bin/activate
    (py3)$ # now install into the activated 'py3' environment ..
    (py3)$ pip install jedi epc
    ...

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Copy link
Owner

asciimoo left a comment

Nice, thanks!

@asciimoo asciimoo merged commit f7a0510 into asciimoo:master Dec 10, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@return42 return42 deleted the return42:boilerplate branch Dec 17, 2019
return42 added a commit to return42/searx that referenced this pull request Dec 18, 2019
With the aim to simplify development cycles, started with PR asciimoo#1756 a Makefile
based boilerplate was added.  This patch adds the missing developer
documentation.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.