Commit graph

124 commits

Author SHA1 Message Date
barredterra
15396ceb60 fix: add required_apps to hooks boilerplate 2023-06-22 15:48:04 +02:00
barredterra
d044b30522 fix: remove app_version from hooks boilerplate
It's not used by any frappe/erpnext code and linters complain about the
unused import
2023-06-22 15:47:34 +02:00
Ankush Menat
32f54b6734 chore: remove socketio from boilerplate workflow
[skip ci]
2023-06-12 12:14:05 +05:30
Ankush Menat
6f4a7ddf10 Revert "build(deps)!: Require NodeJS 18 as minimum version (#21303)"
This reverts commit 67cd951013.
2023-06-11 11:40:22 +05:30
Ankush Menat
67cd951013
build(deps)!: Require NodeJS 18 as minimum version (#21303) 2023-06-10 19:22:57 +05:30
Gursheen Kaur Anand
49fe6e0c98
feat: patches.txt template added by default for new apps #21046 (#21070)
* Added patches.txt template in boilerplate

* test: new app patches.txt

* style: formatting

---------

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-05-24 14:47:06 +05:30
Ankush Menat
5fff6698ad fix: use develop as branch name for new apps
dont ask me why
2023-04-02 15:26:32 +05:30
Gavin D'souza
ea62156a6d fix: Add request, job events in hooks boilerplate 2023-02-10 13:28:50 +05:30
Ankush Menat
87561940a4
feat: Interactively add a new patch (#19722) 2023-01-23 15:04:43 +05:30
Bread Genie
9e79df9802
ci: use $GITHUB_OUTPUT instead of set-output (#19389)
* refactor(boilerplate): use `$GITHUB_OUTPUT` instead of `set-output`

* ci: use `$GITHUB_OUTPUT` instead of `set-output`

* fix: remove unterminated string literal
2022-12-22 14:16:09 +05:30
Bread Genie
211880d693
fix(boilerplate): add redis services in GHA (#19376)
* feat(boilerplate): add redis services

* chore: bump all action versions

[skip ci]

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-12-21 12:39:00 +05:30
Daizy Modi
d88ef967b9
feat: hook ignore_links_on_delete to skip doctypes on delete (#19347)
* feat: hook `ignore_links_on_delete` to skip doctypes on delete

* fix: helper comment

* fix: helper comment

* test: test case for `ignore_links_on_delete`

* test: fix test case
2022-12-20 11:17:28 +05:30
Ankush Menat
eebf7e1fff
chore: dead code removal (#18410)
* chore!: Drop dead code related to configs/moduelview

* chore!: Drop dead boilerplate

* chore: drop desktop.py boilerplate

* chore!: Remove report dump
2022-10-13 15:55:40 +05:30
hrwx
476b628a4e chore: revert changes to github workflow template 2022-08-06 10:52:59 +01:00
hrwx
b01929405d refactor: translatable doctypes 2022-08-05 21:38:10 +01:00
Gavin D'souza
65c6914068 ci: Bump mariadb from 10.3 to 10.6 2022-07-04 12:33:29 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
404d5a3cd7 build!: Bump minimum Python version to 3.10
Given how widespread PY310's usage has become, and how we're just a
few months away from PY311 major release. This is a slightly late
bumping but necessary to ensure smoother updates & maintenance for
Frappe, ERPNext & other apps in the coming years. Almost all people
who participated in the pool from the community as well as Frappe team
voted (via active telegram groups) PY310 as their preferred minimum
requirement for v14.
2022-06-30 13:11:26 +05:30
Gavin D'souza
bd3d7bf3ed ci: Run test builds on min requirement PY38
Since version pinned in pyproject.toml is 38 & we've been running on 39,
we've pushed a few incompatible changes since :crie:
2022-06-29 10:44:55 +05:30
Gavin D'souza
59ab6531c9 ci: Invalidate GHA pip cache on pyproject or setup changes
- Cache invalidated if any of the files change: *requirements.txt,
pyproject.toml, setup.py or setup.cfg
- Updated boilerplate for new apps too
2022-06-15 15:05:37 +05:30
Gavin D'souza
13b18a9118 fix: Regex compilation in boilerplate utils
Flagged via tests in frappe.tests.test_boilerplate
2022-06-09 12:05:07 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
Ankush Menat
8a1889301a chore!: remove dead hooks app_icon & app_color 2022-05-10 14:41:01 +05:30
Ankush Menat
42942f36a6 feat: provide github workflow for unittest in new app 2022-05-10 14:41:01 +05:30
Ankush Menat
3fd4759dd4 fix: gitignore node_modules in new frappe apps 2022-05-10 14:41:01 +05:30
Ankush Menat
53f54c3761 refactor: use click for new-app prompts 2022-05-10 14:41:01 +05:30
Ankush Menat
74d7753a5a refactor: split make_boilerplate function 2022-05-10 14:41:01 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Raffael Meyer
f80a16ed14
feat: add translated search doctypes to hooks (#16197)
In `search.py` it was hardcoded that **DocType** and **Role** get translated before matching against the search text. This way, a user can type in his local language and still see correct results.

This feature is useful for other DocTypes as well. The criterion would be: there is a small, fairly static number of records, so that the performance impact of translating all names first is not too bad.

This PR adds a hook `translated_search_doctypes` that determines which DocType names get translated before search.

I also added **Country** to `translated_search_doctypes` for frappe. The link to **Country** is frequently used in **Address**, but until now there was no way to use it in the local language. There are ~70% less Countries than DocTypes (including ERPNext), so the performance should be fine.

ERPNext could, for example, add the **Gender** DocType to this hook. As there are very few genders, translating them is fast and improves the UX.

Docs: https://frappeframework.com/docs/v13/user/en/python-api/hooks/edit?wiki_page_patch=b4d7c8d6fc
2022-03-23 10:43:04 +00:00
Faris Ansari
bf19ebdeb6
fix(boilerplate): add .gitkeep in public folder (#15765)
add .gitkeep file so that public folder is committed to git this is
needed because if public doesn't exist, bench build doesn't
symlink the public folder to sites/assets
2022-01-27 19:17:41 +05:30
Ankush Menat
fd227d38f4
feat: post model-sync patches (#15351)
Ability to run a few patches after the doctype model schema is synced.

Read module-level docstring of patch_handler.py for more info.
2022-01-26 11:21:30 +05:30
phot0n
1d879f741b feat: before_uninstall and after_uninstall hooks 2021-12-20 14:05:10 +05:30
ritwik
5cfe3ad946
feat: add no-git option in make-app command and boilerplate generation (#15028) 2021-11-23 04:11:06 +00:00
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Sagar Vora
b23dd71116 fix: escape quotes before declaring variables when making a new app 2021-07-13 17:56:47 +05:30
Suraj Shetty
3cbc7dfb92 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-14 12:24:50 +05:30
Gavin D'souza
8e8490976c fix: Remove frappe from boilerplate requirements.txt
Remove frappe from new app boilerplates to avoid possible supply chain attacks. Don't make pip fetch frappe from PyPI
2021-06-07 14:10:49 +05:30
Suraj Shetty
2d8c6c1710 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-03 11:43:28 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
9a3d280484 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-05-13 14:23:20 +05:30
Gavin D'souza
e7d089d1cb Merge branch 'develop' of github.com:frappe/frappe into misc-fixes-py3-1 2021-05-11 13:03:56 +05:30
Suraj Shetty
b39b5effbf Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-05-11 10:38:04 +05:30
Gavin D'souza
b3af9f0c72 fix: Use raw strings for strings with \
Avoid DeprecationWarning which will turn into SyntaxError in later
Python versions
2021-05-07 17:59:20 +05:30
Leela vadlamudi
9d3b993b71
Merge pull request #13144 from ankush/test_create_app
test: add unittest for creating new app using boilerplate
2021-05-07 13:39:24 +05:30
Ankush Menat
c48a8e933f
fix: remove six.moves.input and use builtin.input
reason: py2 support no longer required and six makes mocking/testing
complicated.
2021-05-06 19:26:06 +05:30
Ankush Menat
2548bca187
fix: hook format for user_data_fields 2021-05-06 16:48:59 +05:30
mergify[bot]
585b123bd7
Merge pull request #13134 from ankush/hooks_template_fixes
fix: missing comma and uncommented code in hooks.py template
2021-05-06 09:32:55 +00:00
Ankush Menat
9e39249059
fix: comment user_data_fields and fix structure 2021-05-06 14:01:56 +05:30
Ankush Menat
aba315daf8
fix: missing comma in hooks template 2021-05-06 14:01:39 +05:30
Ankush Menat
a617348a79
chore: remove py2 specific code from boilerplate 2021-05-03 20:11:00 +05:30