2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-23 12:39:01 +00:00
Commit Graph

113 Commits

Author SHA1 Message Date
Ankush Menat
e37df969c1 refactor(migrate_env): virtualenv -> venv 2022-11-29 12:40:11 +05:30
Ankush Menat
4f0193ca93 fix: install one app at a time, frappe first 2022-11-29 12:33:53 +05:30
Ankush Menat
61e0f4acbf fix: correct python path for migrate_env
Currently it's executing env directory which would never work.
2022-11-29 12:23:49 +05:30
Ankush Menat
7f1c5ad9c6 fix: migrate_env silent failures 2022-11-29 12:23:13 +05:30
Ankush Menat
c4305fd528 style: format everything w black 2022-11-23 14:35:01 +05:30
HENRY Florian
9131ba05db
fix: use ref param instead of branch for get_required_deps (GitHub contents API) (#1362)
* fix: use ref param instead of branch

* fix: use ref param instead of branch

* chore: unintentional changes from web editor

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-28 17:59:10 +05:30
HENRY Florian
589f7a400e
fix: bad URL in raw.githubusercontent.com (#1363) 2022-08-28 17:06:06 +05:30
Ankush Menat
b6b9481b7b fix(DX): make warnings go to stderr 2022-08-10 11:42:34 +05:30
Sagar Vora
dc047a5e7d fix: dont use glob pattern for python exec 2022-08-07 01:36:16 +05:30
Gavin D'souza
bbf0169994 fix(nginx): Allow specifying log_format setting
Changes
* Added sugared option class that allows setting options only if another
  is set
* setup nginx command allows to set logging level & log_format options
2022-08-04 16:00:27 +05:30
Gavin D'souza
4014f7349d refactor: Exceptions, variables with pylint 2022-08-03 16:04:21 +05:30
Gavin D'souza
2c5c28bbe2 fix: Remove broken import path 2022-08-03 15:54:44 +05:30
gavin
18a954b88c
Merge pull request #1349 from gavindsouza/frappe-cmd-cache-bye
fix: Remove frappe cmd caching in .bench.cmd
2022-08-02 14:38:37 +05:30
Gavin D'souza
f77352966b fix: Remove frappe cmd caching in .bench.cmd 2022-08-02 13:14:55 +05:30
Gavin D'souza
10473b6007 fix: Pass abs path from get_env_cmd 2022-08-02 12:46:03 +05:30
Gavin D'souza
6ae1997bff fix(utils): Strip * from cmd via get_env_cmd 2022-08-02 12:18:40 +05:30
Gavin D'souza
24b9af605b fix: Use python* to match any pattern in env 2022-08-02 11:59:34 +05:30
Gavin D'souza
b37135e5b1 refactor: get_env_cmd
* Use globbing first to identify cmd in env paths
* Unbound cache which clears on chdir
* Allow passing patterns like 'python*' as cmd to match
2022-08-02 11:57:38 +05:30
Gavin D'souza
f60c2d0def fix: Use venv module instead of virtualenv
Only migrate-env requires virtualenv wrapper. However, it can be
installed and run manually too. Virtualenv wrapper is patched in debian
to change the path of bins - which venv is free from.
2022-08-02 11:54:00 +05:30
Gavin D'souza
e5fa4df5f9 fix: Fetch env python if exists before returning fallback 2022-08-01 11:49:15 +05:30
Gavin D'souza
e126ff2439 fix: Use subscript instead of method for regex
This is another dumb attempt to trigger a release because it doesn't get
triggered without PRs linked or even if they're refactors!
2022-07-30 01:20:24 +05:30
barredterra
df84c2772d fix: use specified python for venv 2022-07-28 14:19:09 +02:00
Gavin D'souza
af46fedc28 refactor(minor): Use more readable alternatives 2022-07-27 14:39:32 +05:30
Gavin D'souza
a84239d6ab refactor: Bench
* Drop patches of v3 & v4
* Re-write buggy / broken code wrt hints by pre-commit checks
* Auto-format and transform code
* Remove re-written & mutable function defaults
2022-07-27 14:39:22 +05:30
Gavin D'souza
a6f196440a refactor(cli): Commands Resolution
The implementations so far were hacks that worked for the most used
commands but broken down when challenged or expected to maintain
documented usages [eg: custom app commands].

The current implementation consists of a two step approach:
1. figure out command name that user is trying to execute
2. pass the directive to the app (bench, frappe or other) that consists of the cmd

---

For tackling #1, get_cmd_from_sysargv contains exhaustive rules that
cover all (that i know and ive come across) combinations of valid
frappe commands.

For problem #2, a simple check in click's Group object does the trick.

Tested with possible known commands with combinations of context flags
and params, with bench, frappe & external app's commands
2022-07-27 11:08:19 +05:30
Gavin D'souza
beac865153 fix: Use == to define had pinned requirement
This allows one to add a dependency like `PyPika = '5.1.0'` directly
instead of `PyPika = '==5.1.0'`
2022-06-29 19:29:31 +05:30
Gavin D'souza
75957a56ee feat: Setup dev-dependencies defined via pyproject
Since support for pyproject.toml exists, Frappe has gotten rid of
requirements.txt file. However, dev-requirements.txt file still existed
in Frappe & other apps. With this, we can get rid of the separate
dev-reqs file as well and replace it by defining the deps in pyproject
under [tool.bench.dev-dependencies]

Example:

For Frappe, this transition will look like moving the contents of
dev-requirements.txt as follows:

```
\# dev-requirements.txt
coverage==5.5
Faker~=13.12.1
pyngrok~=5.0.5
unittest-xml-reporting~=3.0.4

```

```
\# pyproject.toml
[tool.bench.dev-dependencies]
coverage = "==5.5"
Faker = "~=13.12.1"
pyngrok = "~=5.0.5"
unittest-xml-reporting = "~=3.0.4"
```

Note: If dev-dependencies are defined in pyproject.toml, and a
dev-dependencies.txt file exists - the txt file will be ignored.
2022-06-16 18:16:57 +05:30
Gavin D'souza
ffae670be7 fix: (re)Install every Frappe app even if not installed to env 2022-06-16 17:54:21 +05:30
Gavin D'souza
800394cdda feat: Support Frappe app distributions with pyproject.toml
Patches get_app_name which reads app name from pyproject's project.name
attribute, setup.cfg's metadata.name or setup.py's name variable.
2022-06-14 16:01:42 +05:30
Gavin D'souza
e0f6b1735d fix: Remove virtualenv dependency
Use virtualenv cli only if found in PATH. Else use
venv package of the invoker's Python installation.
venv was added in the std lib since PY33.

ref: https://docs.python.org/3/library/venv.html
2022-05-30 14:32:55 +05:30
Devin Slauenwhite
a88932592e
fix: replace certbot-auto with certbot (#1303)
* fix: replace certbot-auto references with certbot and add in prerequesites ansile tasks

* fix: config file flag fix

* fix: certbot path using find_executable instead of hardcoded

* fix: remove easy install entry for certbot

* fix: replace find_executable with which

* fix: no need to check and raise.

* fix: provide user with cerbot install instructions"

* fix: return certbot path

* fix: Use get_certbot_path instead of harcoded path

Co-authored-by: Abhishek Balam <abhishekbalam96@gmail.com>
Co-authored-by: gavin <gavin18d@gmail.com>
2022-05-23 12:44:25 +05:30
gavin
69e14e512f feat(remove-app): Options for no backup of app & force removal 2022-05-19 13:00:09 +05:30
Aradhya
e7055fc6d9 test: Added tests for frappe tags 2022-05-15 23:58:45 +05:30
Aradhya
19f932513f feat: verbose error messages 2022-05-15 23:20:15 +05:30
Aradhya
cb2b0b0d7c feat: using gitpython for branch validation 2022-05-15 17:26:05 +05:30
Revant Nandgaonkar
c943b30c66 fix: allow bench init with git tags 2022-05-15 15:39:08 +05:30
Aradhya
35504f81b3 feat: Added app_name attribute to App class 2022-05-07 02:47:38 +05:30
Ritwik Puri
eb715735bb
fix: Misc fixes (#1294)
* fix: use better api endpoint for is_valid_frappe_branch

* fix: dont allow appnames starting with number and/or dot in them

* fix: dont convert response to json

* fix: using ls-remote to check for valid branches

* refactor: changed the message displayed on invalid branch and invalid frappe path

Co-authored-by: Aradhya <aradhyatripathi51@gmail.com>
Co-authored-by: Aradhya Tripathi <67282231+Aradhya-Tripathi@users.noreply.github.com>
2022-04-27 20:17:04 +05:30
Aradhya Tripathi
c8ef8224d4
fix: fixed org, branch for apps mounted on disk (#1293)
* fix: fixed org, branch for apps mounted on disk

* fix: DRY-er code

* fix: fixed loading apps when use_ssh is true

* fix: removed flaky tests to test dependencies

* fix: removed exception if app not found in frappe or erpnext org

* fix: remote server

* test: Updated tests

fix: tests

* fix: raise when org is not found

* fix: setup requirements

* fix: falling back to original method of mounted app initialization if git repo isn't found
2022-04-19 22:31:51 +05:30
ChillarAnand
e9b0112a9c fix: Check for unauthorized status code in response 2022-04-06 12:05:58 +05:30
Aradhya
339875b2b1 refactor: added message while raising invalidremote exception 2022-04-02 15:05:24 +05:30
Aradhya
dbb19046df fix: checking status code to determine rate limit 2022-03-28 23:36:01 +05:30
Aradhya
bd105a6609 perf: caching deps and orgs, repos to avoid time taking checks & added slower version to check org and repo 2022-03-28 21:02:38 +05:30
Aradhya
2f17da1bf0 fix: support for local and remote apps when looking for dependencies 2022-03-26 00:06:17 +05:30
Aradhya
0b862c0745 feat: Added support for mounted app in get_dependencies 2022-03-25 22:27:58 +05:30
Aradhya Tripathi
8230ba6096
Merge branch 'develop' into dependency-resolution 2022-03-23 23:26:18 +05:30
Aradhya
3ec774946c refactor: Appropriate message for invalid version 2022-03-23 23:23:37 +05:30
Aradhya
cd583f7822 refactor: Added messages on invalid remote exceptions 2022-03-23 18:20:49 +05:30
Ankush Menat
7ab469af84 fix: setup all apps is empty list is supplied 2022-03-22 12:51:29 +05:30
Aradhya
d514f84d5f merge: merged develop into dependency-resolution 2022-03-21 21:50:24 +05:30