Giter Club home page Giter Club logo

briefcase-template's Introduction

logo

BeeWare

Python Versions PyPI Version Maturity BSD License Build Status Discord server

BeeWare is a collection of tools and libraries for building and distributing native applications in Python.

For an introduction to the full BeeWare suite, we recommend running the BeeWare Tutorial.

Community

You can talk to the BeeWare community through:

We foster a welcoming and respectful community as described in our BeeWare Community Code of Conduct.

Contributing

If you experience problems with BeeWare, log them on GitHub. If you want to contribute code, please fork the code and submit a pull request.

Translations

Translation status

We manage translations using Weblate.

Translation status

If you'd like to contribute to the translation effort, join the #translations channel on Discord and introduce yourself!

briefcase-template's People

Contributors

astraluma avatar bittner avatar brutusthebee avatar cimbali avatar codo62 avatar craiglabenz avatar curiouslearner avatar danyeaw avatar dependabot[bot] avatar fablet avatar freakboy3742 avatar fredrikaverpil avatar genevievebuckley avatar glasnt avatar jhakonen avatar jkomalley avatar legaul-cisco avatar mas192 avatar melizeche avatar mfreydavis avatar mhsmith avatar nadi726 avatar piiq avatar qlchan24 avatar rmartin16 avatar seawolf42 avatar yngvem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

briefcase-template's Issues

UTF-format not supported

This is my terminal log. I think there is a problem with the UTF format.

Traceback (most recent call last):
File "/Users/patrick/tutorial-briefcase/venv/bin/cookiecutter", line 11, in
sys.exit(main())
File "/Users/patrick/tutorial-briefcase/venv/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/Users/patrick/tutorial-briefcase/venv/lib/python3.6/site-packages/click/core.py", line 696, in main
_verify_python3_env()
File "/Users/patrick/tutorial-briefcase/venv/lib/python3.6/site-packages/click/_unicodefun.py", line 124, in _verify_python3_env
' mitigation steps.' + extra
RuntimeError: Click will abort further execution because Python 3 wasconfigured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/en/7.x/python3/ for mitigation steps.

This system lists a couple of UTF-8 supporting locales that
you can pick from. The following suitable locales were
discovered: af_ZA.UTF-8, am_ET.UTF-8, be_BY.UTF-8, bg_BG.UTF-8, ca_ES.UTF-8, cs_CZ.UTF-8, da_DK.UTF-8, de_AT.UTF-8, de_CH.UTF-8, de_DE.UTF-8, el_GR.UTF-8, en_AU.UTF-8, en_CA.UTF-8, en_GB.UTF-8, en_IE.UTF-8, en_NZ.UTF-8, en_US.UTF-8, es_ES.UTF-8, et_EE.UTF-8, eu_ES.UTF-8, fi_FI.UTF-8, fr_BE.UTF-8, fr_CA.UTF-8, fr_CH.UTF-8, fr_FR.UTF-8, he_IL.UTF-8,hr_HR.UTF-8, hu_HU.UTF-8, hy_AM.UTF-8, is_IS.UTF-8, it_CH.UTF-8, it_IT.UTF-8, ja_JP.UTF-8, kk_KZ.UTF-8, ko_KR.UTF-8, lt_LT.UTF-8, nl_BE.UTF-8, nl_NL.UTF-8, no_NO.UTF-8, pl_PL.UTF-8, pt_BR.UTF-8, pt_PT.UTF-8, ro_RO.UTF-8, ru_RU.UTF-8, sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8

Click discovered that you exported a UTF-8 locale
but the locale system could not pick up from it because
it does not exist. The exported locale is "de.UTF-8" but it
is not supported``

Add a "live test" to template CI

What is the problem or limitation you are having?

The CI configuration for the briefcase template currently validates the create and build commands, but doesn't do any validation that the app actually runs. It's possible to successfully create an app, but be unable to run that app.

Describe the solution you'd like

As a final step in CI, we should actually run the app.

This will require modifying the test apps so that they will stop (or that logging will stop streaming). Adding a background task that sleeps a second, then calls app.exit() (or equivalent) and outputs a logging sentinel (the same format used for test termination) should be sufficient.

Describe alternatives you've considered

We could just run the app in --test mode; however, that will require rebuilding the app in test mode, which will take a while.

Additional context

No response

Use "compatible release" syntax in pyproject.toml

pyproject.toml currently contains requirements like toga-cocoa>=0.3.0.dev38. Because this has no upper limit, it's bound to cause a compatibility problem eventually, when we make changes to Toga which aren't compatible with old versions of the templates.

Since Toga is now moving to simple 3-level version numbers with no "dev" suffix (beeware/toga#1670), how about changing the template to use "compatible release" syntax like toga-cocoa~=0.3.0? Then, the next time we make a backward incompatible change to Toga, we increment the version number to 0.4.x, and it won't be picked up by any existing project until it's regenerated with a compatible version of the template.

Use `pyside6-essentials` rather than `pyside6` on new apps.

What is the problem or limitation you are having?

When a user specifies that they want to use PySide6 as a GUI framework, Briefcase currently includes pyside6 as the requirement.

Qt now provides a pyside6-essentials package which is substantially smaller, but provides all the core widgets needed for a simple Qt app. pyside6-addons provides other widgets.

Describe the solution you'd like

When using PySide6, the briefcase template should specify PySide6-Essentials rather than pyside6, and provide a second (commented out) inclusion of PySide6-Addons so that it's easy for users to get the extra widgets if they need them.

Describe alternatives you've considered

Continue to use the full PySide6 package.

Additional context

Once this change lands, it may be possible to re-enable the Windows packaging tests for pyside6 (see https://github.com/beeware/briefcase-windows-app-template/blob/main/.github/workflows/ci.yml#L36 and https://github.com/beeware/briefcase-windows-VisualStudio-template/blob/main/.github/workflows/ci.yml#L36), as the path issue should no longer exist.

Briefcase Failing on Ubuntu 18.04 with Python 3.6

I'm trying to follow the Quickstart guide to see how this works and if it's the right fit for my project. However, I'm running into an issue when running python setup.py linux -s. Here is the output of my whole process:

donald@hoth:~$ mkdir briefcase-test
donald@hoth:~$ cd briefcase-test
donald@hoth:~/briefcase-test$ python3 -m venv env
donald@hoth:~/briefcase-test$ source env/bin/activate
(env) donald@hoth:~/briefcase-test$ pip install cookiecutter briefcase
Collecting cookiecutter
  Using cached https://files.pythonhosted.org/packages/16/99/1ca3a75978270288354f419e9166666801cf7e7d8df984de44a7d5d8b8d0/cookiecutter-1.6.0-py2.py3-none-any.whl
Collecting briefcase
  Using cached https://files.pythonhosted.org/packages/8d/45/5f2f23bf9e389857b179347acbd2dcd8de10f110218802240ba0bed10979/briefcase-0.2.6-py3-none-any.whl
Collecting requests>=2.18.0 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl
Collecting poyo>=0.1.0 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/ea/6c/62c76c12015f6a1849446fb73da59be1229312c54d6d05068275e52bf29f/poyo-0.4.1-py2.py3-none-any.whl
Collecting click>=5.0 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Collecting whichcraft>=0.4.0 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/60/8a/5c52e30e11672f7e3aa61f348ddae443d122bcd96bc8b785ac76dbae944b/whichcraft-0.4.1-py2.py3-none-any.whl
Collecting jinja2>=2.7 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting binaryornot>=0.2.0 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl
Collecting jinja2-time>=0.1.0 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl
Collecting future>=0.15.2 (from cookiecutter)
  Using cached https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz
Collecting setuptools>=40.0 (from briefcase)
  Using cached https://files.pythonhosted.org/packages/66/e8/570bb5ca88a8bcd2a1db9c6246bb66615750663ffaaeada95b04ffe74e12/setuptools-40.2.0-py2.py3-none-any.whl
Collecting voc>=0.1.1 (from briefcase)
  Using cached https://files.pythonhosted.org/packages/d2/bc/e8c769eb7d05f486346103783e78ebe283842dd09038ff5b1fa55cda3ad0/voc-0.1.5-py3-none-any.whl
Collecting pip>=18.0 (from briefcase)
  Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Collecting boto3>=1.4.4 (from briefcase)
  Using cached https://files.pythonhosted.org/packages/a8/45/810f786ce144bfd19d9f2f700a8cd4358435559a2b88b2c235f7bb3f29df/boto3-1.8.6-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests>=2.18.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting urllib3<1.24,>=1.21.1 (from requests>=2.18.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.18.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.18.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/df/f7/04fee6ac349e915b82171f8e23cee63644d83663b34c539f7a09aed18f9e/certifi-2018.8.24-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2>=2.7->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Collecting arrow (from jinja2-time>=0.1.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/e0/86/4eb5228a43042e9a80fe8c84093a8a36f5db34a3767ebd5e1e7729864e7b/arrow-0.12.1.tar.gz
Collecting botocore<1.12.0,>=1.11.6 (from boto3>=1.4.4->briefcase)
  Using cached https://files.pythonhosted.org/packages/52/86/73e2825c9f452f6ea7ebbd715aa4621eb1f5d5e51e37cd2019437535909c/botocore-1.11.6-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.4.4->briefcase)
  Using cached https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3>=1.4.4->briefcase)
  Using cached https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl
Collecting python-dateutil (from arrow->jinja2-time>=0.1.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl
Collecting docutils>=0.10 (from botocore<1.12.0,>=1.11.6->boto3>=1.4.4->briefcase)
  Using cached https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->arrow->jinja2-time>=0.1.0->cookiecutter)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Building wheels for collected packages: future, MarkupSafe, arrow
  Running setup.py bdist_wheel for future ... error
  Complete output from command /home/donald/briefcase-test/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wtetc5lv/future/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpx4hkp4vupip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for future
  Running setup.py clean for future
  Running setup.py bdist_wheel for MarkupSafe ... error
  Complete output from command /home/donald/briefcase-test/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wtetc5lv/MarkupSafe/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp1z9t5lispip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for MarkupSafe
  Running setup.py clean for MarkupSafe
  Running setup.py bdist_wheel for arrow ... error
  Complete output from command /home/donald/briefcase-test/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wtetc5lv/arrow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp_e9bcpm5pip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for arrow
  Running setup.py clean for arrow
Failed to build future MarkupSafe arrow
Installing collected packages: idna, urllib3, chardet, certifi, requests, poyo, click, whichcraft, MarkupSafe, jinja2, binaryornot, six, python-dateutil, arrow, jinja2-time, future, cookiecutter, setuptools, voc, pip, jmespath, docutils, botocore, s3transfer, boto3, briefcase
  Running setup.py install for MarkupSafe ... done
  Running setup.py install for arrow ... done
  Running setup.py install for future ... done
  Found existing installation: setuptools 39.0.1
    Uninstalling setuptools-39.0.1:
      Successfully uninstalled setuptools-39.0.1
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed MarkupSafe-1.0 arrow-0.12.1 binaryornot-0.4.4 boto3-1.8.6 botocore-1.11.6 briefcase-0.2.6 certifi-2018.8.24 chardet-3.0.4 click-6.7 cookiecutter-1.6.0 docutils-0.14 future-0.16.0 idna-2.7 jinja2-2.10 jinja2-time-0.2.0 jmespath-0.9.3 pip-18.0 poyo-0.4.1 python-dateutil-2.7.3 requests-2.19.1 s3transfer-0.1.13 setuptools-40.2.0 six-1.11.0 urllib3-1.23 voc-0.1.5 whichcraft-0.4.1
(env) donald@hoth:~/briefcase-test$ cookicutter https://github.com/pybee/briefcase-template

Command 'cookicutter' not found, did you mean:

  command 'cookiecutter' from deb cookiecutter

Try: sudo apt install <deb name>

(env) donald@hoth:~/briefcase-test$ cookiecutter https://github.com/pybee/briefcase-template
You've downloaded /home/donald/.cookiecutters/briefcase-template before. Is it okay to delete and re-download it? [yes]: yes
app_name [appname]: helloworld
formal_name [App Name]: Hello World
description [An app that does lots of stuff]: 
author [Jane Developer]: 
author_email [[email protected]]: 
bundle [com.example]: 
Select license:
1 - BSD license
2 - MIT license
3 - Apache Software License
4 - GNU General Public License v2 (GPLv2)
5 - GNU General Public License v2 or later (GPLv2+)
6 - GNU General Public License v3 (GPLv3)
7 - GNU General Public License v3 or later (GPLv3+)
8 - Other
Choose from 1, 2, 3, 4, 5, 6, 7, 8 [1]: 
Select gui_framework:
1 - Toga
2 - None
Choose from 1, 2 [1]: 
(env) donald@hoth:~/briefcase-test$ cd helloworld
(env) donald@hoth:~/briefcase-test/helloworld$ python setup.py linux -s
running linux
 * Writing application template...
Template Python-Linux-template succesfully updated.
Project template: /home/donald/.cookiecutters/Python-Linux-template
 * Installing requirements...
No requirements.
 * Installing platform requirements...
Traceback (most recent call last):
  File "setup.py", line 79, in <module>
    'toga-django==0.3.0.dev9',
  File "/home/donald/briefcase-test/env/lib/python3.6/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/donald/briefcase-test/env/lib/python3.6/site-packages/briefcase/app.py", line 477, in run
    self.install_platform_requirements()
  File "/home/donald/briefcase-test/env/lib/python3.6/site-packages/briefcase/app.py", line 298, in install_platform_requirements
    stderr=subprocess.STDOUT,
  File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['pip', 'install', '--upgrade', '--force-reinstall', '--target=/home/donald/briefcase-test/helloworld/linux/app_packages', 'toga-gtk==0.3.0.dev9']' returned non-zero exit status 1.
(env) donald@hoth:~/briefcase-test/helloworld$

Add link to briefcase project in auto-generated README.rst

It may be useful to put some kind of link to the briefcase project as a whole in the auto-generated README.rst.

This could be helpful to the user - to have a quick link to the docs - but also acts as free promotion if the link is spread around github a little.

Something as simple as:

"This cross platform app is generated by briefcase - visit the site for full documentation."

Add a unit test suite

#18 fixed a problem with the generated pyproject.toml that was inadvertently introduced when Docker support was added to the template. This fix wouldn't have been needed at all if there was basic pre-merge testing, implemented as a unit test suite.

We should add unit tests template itself. Cookiecutter can be invoked programmatically; so we can run the template with a fixed context and check key properties of the output, like:

  • Can pyproject.toml be parsed without error?
  • Can app.py be compiled without a syntax error? (we don't have to run it - we can use py_compile to compile the code to detect errors)
  • Does flake8 raise any errors on the generated code?

This should be a pytest suite, wrapped with a tox configuration. There should also be a Github Actions configuration that invokes the test suite on every PR. The CI configuration for Briefcase will serve as a starting point for this test setup.

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.