Re: [Python-Dev] do people use sys._mercurial?

2016-01-24 Thread Nick Coghlan
On 24 January 2016 at 05:48, Brett Cannon  wrote:
> On Sat, 23 Jan 2016 at 11:45 francismb  wrote:
>> for me sys._mercurial it's already returning that (?) : what should
>> return now? (it's a bug?)
>
> Depends on your OS and how CPython was built whether it returns that value
> or something more useful. IOW it's not a bug.

Linux distros tend to build Python from a tarball rather than a source
checkout, for example, which means the build directory doesn't include
any VCS details:

$ python3
Python 3.4.3 (default, Jun 29 2015, 12:16:01)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._mercurial
('CPython', '', '')

While my local checkout does have those details:

$ ./python
Python 3.6.0a0 (default:32a4e7b337c9, Jan 23 2016, 12:30:00)
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._mercurial
('CPython', 'default', '32a4e7b337c9')

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] do people use sys._mercurial?

2016-01-24 Thread Nick Coghlan
On 24 January 2016 at 10:29, Brett Cannon  wrote:
> Some discussion happened on core-workflow@, otherwise you can look through
> the python-dev archives for when we added sys._mercurial.

We actually forgot one relevant point in those discussions: there's
already a generic API for accessing this information in the platform
module.

At the sys module level, though, the key point is that the precise
semantic interpretation is VCS dependent, so changing the variable
name conveys immediately to users both that the semantics have
changed, and which VCS is now being used to define them.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Code formatter bot

2016-01-24 Thread francismb
Hi,
from your valuable feedback, here is what I thing could be a previous
requirements list (lets call it for e.g. autopep7 script by now):

- It should follow PEP 7 :-)
- It should check PEP 7 compliance on a per file basis (for simplicity)
- It should be embeddable on the test suite, returning PASS or FAILURE
- It should be usable as a pre-commit hook
- It could return a patch to apply to the non compliant file making it
compliant
- It could return the lines (an the reason why) that aren't compliant


Some other details on using some autopep7 on the infrastructure (as part
of a workflow, by wrapping or enhancing it):

- It could be used it on a regular basis against the cpython repo to be
able to see how much files doesn't follow PEP 7. The first time shows
the legacy ones (plus the current failures).

- It should be used in pair with a "skip" list to avoid checking the
legacy code mentioned (or a list of pairs file:reason to skip).

- It could be used on the CI-side to flag PEP 7 compliance (core-devs
doesn't have to need to point to that in reviews). Or could be used as a
part of series of checks that generate a "ready-to-review" flag.

- It could be used to continually check and proposes patches (on
bug.python.org).

- It could be used to continually check, log the issue on the tracker
and commit the patch to the cpython repository.


Regards,
francis
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] do people use sys._mercurial?

2016-01-24 Thread francismb
Hi,

On 01/24/2016 01:17 PM, Nick Coghlan wrote:
> 
> Linux distros tend to build Python from a tarball rather than a source
> checkout, for example, which means the build directory doesn't include
> any VCS details:
>

Does that helps traceability (reproducibility)? If distros use (?) the
tarball from the release why it doesn't have, at least, the information
from where that tarball was generated from (the check out point) ?

Regards,
francis

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Code formatter bot

2016-01-24 Thread Raymond Hettinger

> On Jan 19, 2016, at 12:59 PM, francismb  wrote:
> 
> Dear Core-Devs,
> what's your opinion about a code-formatter bot for cpython.
> Pros, Cons, where could be applicable (new commits, new workflow, it
> doesn't make sense), ...
> 
> 
> - At least it should follow PEP 7 ;-)

Please don't do this.  It misses the spirit of how the style-guides are 
intended to be used.

"I personally hate with a vengeance that there are tools named after style 
guide PEPs that claim to enforce the guidelines from those PEPs. The tools' 
rigidity and simplicity reflects badly on the PEPs, which try hard not to be 
rigid or simplistic." -- GvR
https://mail.python.org/pipermail/python-dev/2016-January/142643.html

"PEP 8 unto thyself, not onto others" -- Me
https://www.youtube.com/watch?v=wf-BqAjZb8M
(the most popular talk from last year's Pycon)

Almost nothing that is wrong with CPython is stylistic, the real issues are 
more substantive.  That is where you should devote your talents.


Raymond Hettinger
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] do people use sys._mercurial?

2016-01-24 Thread Stephen J. Turnbull
francismb writes:

 > Does that helps traceability (reproducibility)? If distros use (?) 
 > the tarball from the release why it doesn't have, at least, the
 > information from where that tarball was generated from (the check
 > out point) ?

The pointer goes in the other direction: there will be a tag in the
repo named to indicate the version.
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] do people use sys._mercurial?

2016-01-24 Thread Nick Coghlan
On 25 January 2016 at 03:40, francismb  wrote:
> On 01/24/2016 01:17 PM, Nick Coghlan wrote:
>> Linux distros tend to build Python from a tarball rather than a source
>> checkout, for example, which means the build directory doesn't include
>> any VCS details:
> Does that helps traceability (reproducibility)? If distros use (?) the
> tarball from the release why it doesn't have, at least, the information
> from where that tarball was generated from (the check out point) ?

The main reason is that distro packaging processes long predate
Subversion's popularisation of atomic commits in open source version
control tools, and are designed to cope with release processes that
involve uploading a source tarball to a web server, so they don't
assume VCS tags or revision IDs will be available.

However, distro processes also capture the source code itself, and
often apply additional distro-specific patches, at which point
claiming to correspond directly to any given upstream commit would be
inaccurate.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com