2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-29 07:19:05 +00:00
Commit Graph

1032 Commits

Author SHA1 Message Date
Gavin D'souza
ba289fba25 refactor(log): use click to colour everything
A year (longer) ago, I added color to bench manually. I hadn't explored
much of click back then. Had to figure out when we had to and we didnt
have to colour stuff. At times the chars would just be ignored and
rather printed to the terminal which was awkward...anyway, here,
goodbyetoallthat :cheers: (hopefully)
2021-10-30 02:40:29 +05:30
Gavin D'souza
20560c97c4 feat: Skip warnings if envvar BENCH_DEVELOPER set 2021-10-30 02:39:14 +05:30
Gavin D'souza
616dff8fbb fix: Drop support for Frappe v4-5-6 ;)
This was long time due. Removing software that won't be compatible with
this version of Bench is a no-brainer. Sorry for not posting this in
advance but the world has been moving too fast.

Use `pip install frappe-bench --only-binary='all'` to install the latest
supported version for your machine :D
2021-10-30 02:35:32 +05:30
Gavin D'souza
984959beb8 refactor: Adoption of new style Bench notations
* Updated multiple functions
* Updated flow & re-ordered steps of `bench init` - tested with multiple
  args
* Updated exceptions
2021-10-30 02:32:04 +05:30
Gavin D'souza
153546afd7 refactor: Simplify Bench with OOP
Goals:
- Commonify bench operations in a way that intuitive
- Get rid of the multiple duplicate functions because it's so hard to
  understand flow in the codebase ;)
- Eliminate the need to guess, re-guess and pass bench info in each
  function that needs to do literally anything
- Increase my happiness index because I just realised that I'm the top
  contributor of this project and I'd like to make it my own.
- Adopt the principles of Least Surprise & The Principle of The Bigger Smile (of DHH) [inspired by ruby & ror]

Changes:
- The bench module has Bench and the action classes that can be accessed
  through the bench object
- Used the Bench class to access properties like sites, apps & run (to execute commands in context) to reduce effort and clutter
- Style improvements & minor changes included
2021-10-30 02:25:38 +05:30
Gavin D'souza
b59379c5a9 refactor(minor): AppMeta class
* Fix tuple addition
* Rename App to AppMeta - it's more apt given how Bench classes are
  being structured now
2021-10-30 02:06:10 +05:30
Gavin D'souza
c5a38b3647 refactor: Exceptions, Setup & Styles 2021-10-21 16:37:49 +05:30
gavin
8d5f408204
Merge branch 'develop' into get-app-on-steroids 2021-10-20 21:38:52 +05:30
Gavin D'souza
c060ce7b54 refactor(minor): bench install-app
Getting rid of the dependency on the manual coloring of all prints using
color
2021-10-20 19:43:10 +05:30
Gavin D'souza
dafddaef6d refactor: bench get-app
* Added app dependencies resolving using `required_apps`
* Simplified workflow + docstring to explain what's goin on xD
* Get rid of redundant restart_bench kwarg from get_app
2021-10-20 19:42:52 +05:30
Gavin D'souza
1865eeeb6d feat(minor): App Meta handling on disk repos 2021-10-20 19:33:16 +05:30
Gavin D'souza
38382b84fb feat: Initialize bench on bench get(-app) if not created
Why bother creating a bench well in advance? If someone wants to install
your app, they should be able to with a single command.

For instance, you can run simply `bench get healthcare` in any directory and bench will be setup automatically
2021-10-20 01:05:40 +05:30
Gavin D'souza
b75d352454 feat: Aliased Commands
* Added alias for get-app as get
* Now run `bench get erpnext` to install ERPNext on your bench
2021-10-20 00:45:05 +05:30
Gavin D'souza
906ad5a099 feat: bench drop {bench_path}
* Drops bench if no sites' folders found
* Tries to drop crontab entry made for backups
2021-10-20 00:43:46 +05:30
Gavin D'souza
ce00798b5d feat: App Meta Base Class
* Less messier way of setting up and managing pre-fetched app meta
* Added support to fetch apps using the GitHub org/repo pattern
* Can be used to get apps and easily handle dependencies through version
  identifiers
2021-10-20 00:37:36 +05:30
Pruthvi Patel
a28a0d0d23 fix: correct patches.txt 2021-10-18 18:21:24 +05:30
Pruthvi Patel
9f74ec0adb feat: add live_reload to default_config 2021-10-18 16:29:05 +05:30
Francisco Roldán
593b80eec9
feat: Add custom workers in Procfile (#1201)
* feat: updated procfile

* fix: add missing context

* fix: add missing context
2021-10-07 12:20:36 +05:30
kevgeni
641181260e
fix: Allow git url with custom username (#1200)
Allow git url with custom user, and not just the git user.
2021-09-17 15:29:14 +05:30
Francisco Roldán
e0b9461d41
Merge branch 'develop' into queues 2021-09-14 08:43:31 -03:00
Francisco Roldan
75f84625ad fix: rename key 2021-09-14 08:42:06 -03:00
Ankush Menat
b51f0ed2b2
feat: bench setup requirements --dev (#1196)
* chore: typo

* chore: update project description

* feat: command to install dev-requirements.txt

Often applications have development or test specific requirements which
are not required in production.

- Add new command `bench setup dev-requirements`
- installs all `dev-requirements.txt` in app's root folder.

* refactor: remove duplicate function

* refactor: use `log` instead of print

* refactor: merge dev-requirement command

* feat: install dev-dependencies in get-app if dev

When developer mode is enabled install all dev dependencies too while
doing `get-app`

* fix: warn about --dev not supporting node
2021-09-13 20:55:21 +05:30
Francisco Roldán
58ef0ac430
Merge branch 'develop' into queues 2021-09-09 08:56:34 -03:00
Gavin D'souza
6fd3ad738b fix(command_cache): Return iterable as fallback 2021-09-09 16:05:42 +05:30
Gavin D'souza
b35af193d3 chore: Remove unnecessary returns, re-order cli resolution
Changes suggested by LGTM https://lgtm.com/projects/g/frappe/bench/rev/pr-560978725461013796d605b409ffc5c85c774829
2021-09-09 14:56:32 +05:30
Gavin D'souza
a015501699 fix: Return fallback list in cached_frappe_commands 2021-09-09 13:54:35 +05:30
Gavin D'souza
6160ff48ab style: Black 2021-09-09 13:54:19 +05:30
Gavin D'souza
552b935f6b fix: Always set return code via cli 2021-09-09 13:20:26 +05:30
Gavin D'souza
a94ea19bf4 fix: Hit command cache before fetching all commands 2021-09-09 13:19:44 +05:30
Francisco Roldan
e12f53d1a5 feat: added option to provide custom queues 2021-08-30 12:35:53 -03:00
gavin
beb14c8681
Merge branch 'develop' into referrer-policy 2021-08-30 12:38:59 +05:30
Abhishek Balam
6137086e03
feat: Set default version for easy install to v13 (#1189)
* feat: set default version for easy install to v13

* fix: python version based version picking fixed and reverted changes to node version in installation script

* fix: revert test version

Co-authored-by: gavin <gavin18d@gmail.com>
2021-08-30 12:29:09 +05:30
leela
46e66226c2 feat: Redis ACL config is added to conf templates 2021-07-20 06:22:15 +05:30
Roberto Murguia
a514a0e97b fix: ssl nginx directive deprecation 2021-06-15 09:35:04 -05:00
Gavin D'souza
5e0d46db24 Merge branch 'develop' into perf-remove-app 2021-05-13 14:18:15 +05:30
Gavin D'souza
54d48f61a3 fix: Remove PY2 compatibility code
* Set Python requires Python 3.6+ but < Py4
* Remove six from dependencies
* Use click.confirm instead of self implemented confirm code
* Fix imports for 3.6+ compatibility

References for updated imports:
* https://docs.python.org/3/library/configparser.html
* https://docs.python.org/3/library/urllib.request.html#legacy-interface
* https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse
* https://docs.python.org/3/library/importlib.html#importlib.reload
2021-05-11 12:01:32 +05:30
Gavin D'souza
5d563f23ab style: Use f-strings instead of old string formatting methods
These changes are valid only for Py3.6+ and will remove bench CLI
support for Python 3.5 and lesser.

* Converted to f-strings using flynt
* Manual conversion of failed cases
* Simplification of logic
2021-05-11 11:30:27 +05:30
Gavin D'souza
dcdb15d471 fix: Handle command execution failures 2021-05-10 19:10:06 +05:30
gavin
0c21718f7a
Merge branch 'develop' into perf-remove-app 2021-05-10 18:51:57 +05:30
Gavin D'souza
01abc561e0 fix: Added warning for unshallow without --reset 2021-05-10 17:35:31 +05:30
Gavin D'souza
f46126ce2b chore: Remove deprecated option from config template 2021-05-10 14:51:52 +05:30
Gavin D'souza
096c2cfe6b fix: Show step titles while running operations 2021-05-10 14:51:14 +05:30
Gavin D'souza
4cadf2c719 fix: Unshallow clone if update without --reset
If an unshallow clone has to be updated, the only way to update it
without a reset will require an unshallow. This is because there may be
uncommitted or committed changes in any of the apps, although unfavoured
should be handled safely. The only way to update such repos is via the
user configured settings..or a ff only merge.
2021-05-10 14:45:46 +05:30
Gavin D'souza
ebc3cebd19 perf: Faster bench remove-app
Biggest bottleneck is in the validation stage which checks if the app is
installed on any existing sites on the bench. instead of triggering
multiple list-apps for each sites, do one for all.
2021-05-05 16:34:10 +05:30
Gavin D'souza
ed3f2d28fb fix: Remove set-default-site from CLI 2021-04-26 20:16:16 +05:30
Hussain Nagaria
324b58622c chore: Remove set-default-site command 2021-04-26 17:06:30 +05:30
Gavin D'souza
64fbeee1e6 Revert "fix: Use execve and set envvars instead of execv"
This reverts commit 530a980ef7.
2021-04-26 11:32:20 +05:30
Gavin D'souza
7e1db3fd74 test: Update env test
Env folder's include may be empty or non existent
2021-04-23 19:14:30 +05:30
Gavin D'souza
530a980ef7 fix: Use execve and set envvars instead of execv
Changed from execv to execve with empty env dict because bench commands on macOS 10.14.6 PY3.9.0a4 fails with "Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')"

This error has come up in the past too. I'm now suspecting it has
something to do with the current process passing on it's environment
variables to the process that's going to replace it, which causes these
issues.

Note that direct execution of the commands without the bench wrapper
worked fine although via bench failed with the specified error
2021-04-23 18:38:27 +05:30
Gavin D'souza
b0ccb6efbe fix: Invoke pip via python
Due to "WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly."
2021-04-23 18:37:03 +05:30