Giter Club home page Giter Club logo

plone.recipe.sublimetext's Introduction

Egg Status Travis Build Status Test Coverage Python Versions Latest Version License

plone.recipe.sublimetext is the buildout recipe for ST3 lover who wants python IDE like features while developing python Buildout based project. This tool will help them to create per project basis sublimetext settings with appropriate paths location assignment. Currently plone.recipe.sublimetext comes with supporting settings for Anaconda (the all-in-one package), Jedi, Sublimelinter, Sublimelinter-Flake8, Sublimelinter-Pylint. A general question may arise that why we will use this tool, whether we can create ST3 project settings easily (we have better knowledge over ST3 configuration)? Well i completely agree with you, but if you want to get benefited from Anaconda or Jedi's python autocompletion feature (basically I am lover of autocompletion), you have to add all eggs links for Anaconda or Jedi's paths settings and it is hard to manage eggs links manually if the size of project is big (think about any Plone powered project), beside Sublimelinter-Pylint also need list of paths to be added to sys.path to find modules.

Install plone.recipe.sublimetext is simple enough, just need to create a section for sublimetext to your buildout. Before using plone.recipe.sublimetext make sure Jedi, Sublimelinter, Sublimelinter-Flake8 and/or Sublimelinter-Pylint plugins are already installed at your ST3. You could follow full [instruction here] if not your ST3 setup yet. Flake8 linter need flake8 executable available globally (unless you are going to use local flake8), also it is recommended you install some awsome flake8 plugins (flake8-isort, flake8-coding, pep8-naming, flake8-blind-except, flake8-quotes and more could find in pypi)

Example Buildout:

[buildout]
parts += sublimetext

[sublimetext]
recipe = plone.recipe.sublimetext
eggs = ${buildout:eggs}
jedi-enabled = True
sublimelinter-enabled = True
sublimelinter-pylint-enabled = True
eggs

Required: Yes

Default: None

Your project's list of eggs, those are going to be added in path location for Jedi and/or Sublimelinter-Pylint or Anaconda.

overwrite

Required: No

Default: False

This option indicates whether existing settings should be cleaned first or just updating changes. This situation may happen, you did create settings file manually with other configuration (those are not managed by plone.recipe.sublimetext) and you want keep those settings intact.

python-executable

Required: No

Default: plone.recipe.sublimetext will find current python executable path.

The python executable path for current project, if you are using virtual environment then should be that python path. FYI: ${home} and ${project} variable should work.

project-name

Required: No

Default: if you have a existing ST3 project file(settings file) in project/buildout's root directory, plone.recipe.sublimetext will choose it as project-name, other than project/buildout directory name will become as project-name

Don't add suffix .sublime-project, when you provide the project name.

jedi-enabled

Required: No

Default: False

This option is related to enable/disable Sublime Jedi

jedi-use-omelette

Required: No

Default: False

Use the omelette as basis for jedi autocompletion and go-to-definition. See collective.recipe.omelette

omelette-location

Required: No

Default: ${buildout:directory}/parts/omelette - the default omelette location.

For use with jedi-use-omelette, but unless the omelette is installed at a custom location, the default should be fine.

sublimelinter-enabled

Required: No

Default: False

Whether Sublimelinter's features you want to use or not.

sublimelinter-pylint-enabled

Required: No

Default: False

If you want to use Sublimelinter-Pylint or not; sublimelinter-enabled option will be respected, means if parent option is set as disabled but you enable this option will not work.
sublimelinter-pylint-executable

Required: No

Default: ''

You could provide buildout specific pylint executable. It is very flexible way to avoid using global pylint. Example of relative path usecase: i.) ${buildout:directory}/bin/pylint ii.) $project_path/bin/pylint iii.) ./bin/pylint iv.) ~/path/bin/pylint

sublimelinter-pylint-args

Required: No

Default: ''

@see bellow at sublimelinter-flake8-args section for full detail.

sublimelinter-flake8-enabled

Required: No

Default: False

Whether you want to use Sublimelinter-Flake8 or not. Like sublimelinter-pylint-enabled parent option will be respected.

sublimelinter-flake8-executable

Required: No

Default: ''

Project specific Flake8 executable path, this will give you lots flexibility over using global Flake8 executable, because each project might have separate Python version. You could use buildout or user's relative directory path and it is very convenient for collboration works where all members' absolute path of flake8 excecutable may not be the same! Example of relative path usecase: i.) ${buildout:directory}/bin/flake8 ii.) $project_path/bin/flake8 iii.) ./bin/flake8 iv.) ~/path/bin/flake8

sublimelinter-flake8-args

Required: No

Default: ''

It is possible to provide arguments (options) for flake8 executable project specific. You have to follow a simple format to provide multiple arguments aka flake8 options thanks to buildout for making our life easy. Format {option name}={option value(optional if the arg boolen type)} max-line-length=90, it is remarkable that -- prefix is not required, you can provide multiple arguments separated by space and/or newline

  1. sublimelinter-flake8-args = max-line-length=90 --show-source
  2. sublimelinter-flake8-args = max-line-length=90 --show-source
    output-file=path_to_file
anaconda-enabled

Required: No

Default: False

This option is related to whether you want to enable Anaconda the all-in-one python IDE package!

anaconda-linting-enabled

Required: No

Default: True

If want to other library for liniting (i.e sublimelinter), keep it disabled, other than should be enabled. Like other parent options, it will respect parent (anaconda-enabled) option.

anaconda-completion-enabled

Required: No

Default: True

Anaconda is using Jedi engine for autocompletion, but if you want to use Sublime-Jedi other than provided by Anaconda, make it disabled.

anaconda-pylint-enabled

Required: No

Default: False

By default Anaconda liniting doing validation using PyFlakes, PEP8, PEP257. But you can use Pylint instead of PyFlakes by enabling this option.

anaconda-validate-imports

Required: No

Default: True

It is always good that you want to see any invalid imports (for example: from fake.foo import bar), but if you don't want this just disabled this option.

anaconda-pep8-ignores

Required: No

Default: ''

If you want ignore some pep8 checklist (i.e N802 is for pep8 naming). Each ignore should be separated by space and/or newline.

anaconda-pep257-enabled

Required: No

Default: False

Indicates whether you want to active pep257 checklist by anaconda.

anaconda-pep257-ignores

Required: No

Default: ''

If you want ignore some pep8 checklist (i.e N802 is for pep8 naming). Each ignore should be separated by space and/or newline.

ignore-develop

Required: No

Default: False

If you don't want development eggs, should go for autocompletion.

ignores

Required: No

Default: ""

If you want specific eggs should not go for autocompletion.

packages

Required: No

Default: ""

Location of some python scripts or non standard modules (don't have setup file), you want to be in system path.

Code repository:

https://github.com/collective/plone.recipe.sublimetext

Continuous Integration:

https://travis-ci.org/collective/plone.recipe.sublimetext

Issue Tracker:

https://github.com/collective/plone.recipe.sublimetext/issues
  • Sublimelinter-Flake8 might stop working if flake8-plone-api is installed as until 1.2 version, flake8-plone-api don't support SublimeText (linting), see pull request here . That means upcoming version will support hopefully. It could happen, either you are using global or virtualenv flake8. You can see error in ST3 console:

    flake8_plone_api-1.2-py2.7.egg/flake8_plone_api.py", line 16, in run
    with open(self.filename) as f:
    IOError: [Errno 2] No such file or directory: 'stdin'
    

plone.recipe.sublimetext's People

Contributors

nazrulworld avatar sunew avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

plone.recipe.sublimetext's Issues

Install using pip in virtualenv got error but fine with easy_install

Exception: Traceback (most recent call last): File "/tmp/py2env/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/tmp/py2env/local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run wb.build(autobuilding=True) File "/tmp/py2env/local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "/tmp/py2env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/tmp/py2env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file check_dist_requires_python(dist) File "/tmp/py2env/local/lib/python2.7/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python feed_parser.feed(metadata) File "/usr/lib/python2.7/email/feedparser.py", line 177, in feed self._input.push(data) File "/usr/lib/python2.7/email/feedparser.py", line 99, in push parts = data.splitlines(True) AttributeError: 'NoneType' object has no attribute 'splitlines'

Flake8 custom executable, complain from plone-api-flake8

This is might be bug from https://pypi.python.org/pypi/flake8-plone-api

Traceback (most recent call last):
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/bin/flake8", line 31, in <module>
    sys.exit(flake8.main.cli.main())
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/main/cli.py", line 16, in main
    app.run(argv)
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/main/application.py", line 328, in run
    self._run(argv)
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/main/application.py", line 316, in _run
    self.run_checks()
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/main/application.py", line 246, in run_checks
    self.file_checker_manager.run()
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/checker.py", line 319, in run
    self.run_serial()
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/checker.py", line 303, in run_serial
    checker.run_checks()
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/checker.py", line 573, in run_checks
    self.run_ast_checks()
  File "/home/nazrul/www/python/Doctor_Assistant/dra.didb/lib/python2.7/site-packages/flake8/checker.py", line 487, in run_ast_checks
    for (line_number, offset, text, check) in runner:
  File "/home/nazrul/APPS/buildout-cache/eggs/flake8_plone_api-1.2-py2.7.egg/flake8_plone_api.py", line 16, in run
    with open(self.filename) as f:
IOError: [Errno 2] No such file or directory: 'stdin' 

Required options for sublime text project file is missing

"folders":
	[
		{
			"path": "."
		}
	]

Path is required (minimal) settings for sublime text project file, but right plone.recipe.sublimetext not caring about this! meaning if any valid project file (manually created) not exist, generated setting will not work!

Support for Anaconda

Anaconda is very powerful and all-in-one kind package for SublimeText that can transform for editor as IDE for python based development. It has active community based continuous development.

Idea here This recipe will support project based settings for Anaconda. Primary two parts are involved in project settings.

"build_systems":[ { "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "name": "Anaconda Python Builder", "selector": "source.python", "shell_cmd": "\"./bin/python\" -u \"$file\"" } ]
"settings": { "python_interpreter": None, "extra_paths": [] }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.