Bug 209871 - [NEW PORT] lang/py-mypy-lang: Optional static typing for Python
Summary: [NEW PORT] lang/py-mypy-lang: Optional static typing for Python
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: David Naylor
URL:
Keywords: easy, feature, patch
Depends on:
Blocks:
 
Reported: 2016-05-30 21:25 UTC by Florian Limberger
Modified: 2017-02-21 06:29 UTC (History)
3 users (show)

See Also:


Attachments
Port directory shar (1.51 KB, text/plain)
2016-05-30 21:25 UTC, Florian Limberger
no flags Details
adjusted mypy port (1.63 KB, text/plain)
2016-05-31 07:36 UTC, Shane
no flags Details
Added multiple licenses to Makefile (1.68 KB, text/plain)
2016-05-31 20:23 UTC, Florian Limberger
no flags Details
Update to v0.4.6, move to devel and use a suffix (1.81 KB, patch)
2016-12-18 17:58 UTC, David Naylor
dbn: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Limberger 2016-05-30 21:25:22 UTC
Created attachment 170841 [details]
Port directory shar

Mypy is an optional static type checker for Python. You can add type hints to
your Python programs using the standard for type annotations introduced in
Python 3.5 (PEP 484), and use mypy to type check them statically. Find bugs in
your programs without even running them!
Comment 1 Shane 2016-05-31 07:36:44 UTC
Created attachment 170849 [details]
adjusted mypy port

Looks like an interesting project.

The port name - python modules should be prefixed with py- and use PKGNAMEPREFIX=${PYTHON_PKGNAMEPREFIX} in the Makefile. Using the name mypy comes with conflicts, there is a mypy module on pypi with that name which is a wsgi framework, this project uses the pypi name of mypy-lang which would lead to a port name of lang/py-mypy-lang

Setting MASTERSITES=CHEESESHOP allows the use of pypi and removes USE_GITHUB

The pkg-descr should have WWW: http://www.mypy-lang.org

As this installs scripts into bin concurrent should be used, trouble with this is the inability to install a 2.7 package leaves only mypy-3.4 mypy3.5... so you may want to leave out concurrent.
Comment 2 Shane 2016-05-31 09:25:21 UTC
Actually we missed that it is dual licensed, "...the files
under stdlib-samples and lib-typing are licensed under the PSF..."

You should use -

LICENSE= MIT PSFL
LICENSE_COMB= multi
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE
Comment 3 Florian Limberger 2016-05-31 20:23:49 UTC
Created attachment 170889 [details]
Added multiple licenses to Makefile

Updated the shar to incorporate the license changes
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2016-09-28 11:27:27 UTC
Minor nit, python:3 should be python:X.Y+

:3 means depend on the devel/python3 port and symlink, not "any version of Python 3.x"
Comment 5 David Naylor freebsd_committer freebsd_triage 2016-12-18 17:58:44 UTC
Created attachment 178062 [details]
Update to v0.4.6, move to devel and use a suffix

Citing devel/pylint as precedence:
 a) Move to the devel category: it is only used for development of software
 b) Change to a suffix as this is mainly a command line tool (and not a module)
 c) Update to 0.4.6 (thanks to the port design, a very easy change)
 d) Remove concurrency: the typesetting library is not installed in a python version specific location

I would prefer to rename this port to mypy-lang (a la pylint) but we'll see what the python team says.
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-01-26 06:19:31 UTC
A commit references this bug:

Author: dbn
Date: Thu Jan 26 06:18:30 UTC 2017
New revision: 432468
URL: https://svnweb.freebsd.org/changeset/ports/432468

Log:
  devel/py-typed-ast: add new port.

  Typed AST is a fork of the CPython 2.7 and 3.5 ast modules with the ability to
  parse PEP 484 type comments. The primary goals of Typed ASP are correctness and
  speed.

  PR:		209871

Changes:
  head/devel/Makefile
  head/devel/py-typed-ast/
  head/devel/py-typed-ast/Makefile
  head/devel/py-typed-ast/distinfo
  head/devel/py-typed-ast/pkg-descr
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-01-26 17:46:19 UTC
A commit references this bug:

Author: jbeich
Date: Thu Jan 26 17:45:37 UTC 2017
New revision: 432523
URL: https://svnweb.freebsd.org/changeset/ports/432523

Log:
  devel/: unbreak whole-tree build after r432468

  $ nice poudriere bulk -j ... -a
  [...]
  [00:18:34] ====>> Warning: Nonexistent port listed in category Makefiles: devel/py-typed-asp
  [00:56:50] ====>> (-C) Cleaning specified ports to build
  [00:56:50] ====>> Error: Invalid port origin 'devel/py-typed-asp' not found.

  PR:		209871

Changes:
  head/devel/Makefile
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-02-21 06:11:04 UTC
A commit references this bug:

Author: dbn
Date: Tue Feb 21 06:10:12 UTC 2017
New revision: 434504
URL: https://svnweb.freebsd.org/changeset/ports/434504

Log:
  devel/py-mypy: add new port

  Mypy is an optional static type checker for Python. You can add type hints to
  your Python programs using the standard for type annotations introduced in
  Python 3.5 (PEP 484), and use mypy to type check them statically. Find bugs in
  your programs without even running them!

  PR:		209871
  Submitted by:	Florian Limberger (flo@snakeoilproductions.net)

Changes:
  head/devel/Makefile
  head/devel/py-mypy/
  head/devel/py-mypy/Makefile
  head/devel/py-mypy/distinfo
  head/devel/py-mypy/files/
  head/devel/py-mypy/files/patch-mypy_fastparse.py
  head/devel/py-mypy/files/patch-mypy_fastparse2.py
  head/devel/py-mypy/pkg-descr
Comment 9 David Naylor freebsd_committer freebsd_triage 2017-02-21 06:29:46 UTC
Committed.  Thank you for submitting the port, and apologies for taking so long to commit it.  

Some changes I made prior to committing:
 - PORT(NAME/VERSION): update to the latest version and track name change: since I took so long
 - CATEGORIES: change from lang to devel: pre the pypi page it is indicated that the intended audiance is developers
 - RUN_DEPENDS: added py-typed-ast as a dependency: required for --fast-parse (that is likely to become default)
 - RUN_DEPENDS: add py-typing as a dependency for Python < 3.5: as required by setup.py
 - USES: depend on python >= 3.3: USES=python:3 implies the port depends on the binary python3 however this port installs files into site-packages and thus it is incorrect to depend on the python meta-port
 - USES_PYTHON: remove concurrent: having concurrent here is correct, however due to a bug in the python framework it fails to create the binary 'mypy', instead it only creates 'mypy-3.5'.  This will need to be reverted after bug #216479 is fixed
 - files: add patches to support py-typed-ast >=1.0.0