Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.mail-parser: init at 3.3.1 #40353

Merged
merged 2 commits into from May 17, 2018
Merged

Conversation

PsyanticY
Copy link
Contributor

@PsyanticY PsyanticY commented May 11, 2018

Motivation for this change

mail-parser is not only a wrapper for email Python Standard Library. It gives an easy way to pass from raw mail to Python object.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

pname = "mail-parser";
version = "3.3.1";

src = fetchPypi {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FRidh Fixed (sorry for that)


propagatedBuildInputs = [ ipaddress six simplejson ];

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the tests disabled? Include a comment in the expression explaining why the tests are disabled.

@PsyanticY
Copy link
Contributor Author

@FRidh Fixed indentation and enabled tests back.

propagatedBuildInputs = [ ipaddress six simplejson ];

meta = with stdenv.lib; {
description = "A mail parser for python 2 and 3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indentation

version = "3.3.1";

src = fetchPypi {
inherit pname version;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indentation

@dotlambda
Copy link
Member

Instead of removing meta.maintainers, you should add yourself to https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix.

@PsyanticY
Copy link
Contributor Author

@dotlambda Addressed your comments ^^ .

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.mail-parser python3.pkgs.mail-parser

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: python2.pkgs.mail-parser, python3.pkgs.mail-parser

Partial log (click to expand)

reading manifest file 'mail_parser.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mail_parser.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
error: build of '/nix/store/hw75k2xvyns149wixzg2s32k4xjv95bb-python3.6-mail-parser-3.3.1.drv' failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: python2.pkgs.mail-parser, python3.pkgs.mail-parser

Partial log (click to expand)

reading manifest file 'mail_parser.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mail_parser.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
�[31;1merror:�[0m build of '/nix/store/2mg5y87yr3js3p8lza05y097pqlxsrj5-python3.6-mail-parser-3.3.1.drv' failed

@dotlambda
Copy link
Member

Ran 0 tests in 0.000s

You have to specify an appropriate checkPhase.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6050: ordinal not in range(128)

This probably means you have to set LC_ALL and add glibcLocales to nativeBuildInputs.

@PsyanticY
Copy link
Contributor Author

@dotlambda Fixed the decoding issue. When building the package on python 3.6 it complaion about the unavailability of the package "ipaddress". it turns out that the package is enabled for python 3.2 or less.
ipaddress = if (pythonAtLeast "3.3") then null else buildPythonPackage rec{
I removed that and build if for python36 and 35 successfully. I think the (pythonAtLeast "3.3") was due to this description of the package "Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2." i created an issue and asked the package owner why is that the case. he affirmed the following: ""By the way, 3.3+ means 3.3 or any newer version, e.g. 3.4, 3.5, 3.6, 4.0.""", here is the issue

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When building the package on python 3.6 it complaion about the unavailability of the package "ipaddress". it turns out that the package is enabled for python 3.2 or less.

That's because new versions of Python have it as part of stdlib.

I removed that and build if for python36 and 35 successfully.

No, that should not be done, because we should avoid shadowing standard library modules. The package mail-parser should only depend on ipaddress for older versions of Python.

@@ -0,0 +1,26 @@
{ stdenv, pkgs, buildPythonPackage, glibcLocales, fetchPypi, ipaddress, six, simplejson }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no pkgs

@@ -6699,7 +6701,7 @@ in {
};
};

ipaddress = if (pythonAtLeast "3.3") then null else buildPythonPackage rec {
ipaddress = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be undone

@PsyanticY
Copy link
Contributor Author

@dotlambda Can you please take a look ^_^

@dotlambda dotlambda force-pushed the mail-parser branch 3 times, most recently from 1efac83 to ce921cd Compare May 17, 2018 06:28
@dotlambda dotlambda changed the title mail-parser python(2/3) package pythonPackages.mail-parser: init at 3.3.1 May 17, 2018
@dotlambda
Copy link
Member

@Assassinkin Please have a look at my changes.

@GrahamcOfBorg build python2.pkgs.mail-parser python3.pkgs.mail-parser

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python2.pkgs.mail-parser, python3.pkgs.mail-parser

Partial log (click to expand)

        "StartBoundaryNotFoundDefect: The claimed start boundary was never found.",
        "MultipartInvariantViolationDefect: A message claimed to be a multipart but no subparts were found."
      ]
    }
  ],
  "defects_categories": [
    "MultipartInvariantViolationDefect",
    "StartBoundaryNotFoundDefect"
  ]
}

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python2.pkgs.mail-parser, python3.pkgs.mail-parser

Partial log (click to expand)

      ]
    }
  ],
  "defects_categories": [
    "MultipartInvariantViolationDefect",
    "StartBoundaryNotFoundDefect"
  ]
}
/nix/store/819dksk3cm5jndj4kdpi5cndhd1sy26j-python2.7-mail-parser-3.3.1
/nix/store/lamxjaljnsbsvfsci4384y58vjybqhkf-python3.6-mail-parser-3.3.1

@PsyanticY
Copy link
Contributor Author

@dotlambda Looks way better. Thanks for the help.

@dotlambda dotlambda merged commit 2c91ab5 into NixOS:master May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants