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

translate-toolkit: Init at 2.2.5 #30307

Closed
wants to merge 1 commit into from

Conversation

phile314
Copy link
Contributor

Motivation for this change

Add the translation-toolkit tools:
http://toolkit.translatehouse.org/

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.

@Mic92
Copy link
Member

Mic92 commented Oct 11, 2017

Is this supposed to be used as a python library or a set of command-line tools?

@phile314
Copy link
Contributor Author

In the end it's both as it has a lot of executable tools ( http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/index.html ) but also an API ( http://docs.translatehouse.org/projects/translate-toolkit/en/latest/api/index.html ). I am only using the tools and I think those are more important/popular. Is there an easy way to make it both a normal library package and a set of command-line tools in nixpkgs?

@@ -0,0 +1,31 @@
{ stdenv, fetchFromGitHub, python3Packages, makeWrapper }:

python3Packages.buildPythonApplication rec{
Copy link
Member

@Mic92 Mic92 Oct 12, 2017

Choose a reason for hiding this comment

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

We don't store python applications here, as we we build pythonPackages against multiple python versions.
Please change to buildPythonLibrary here and remove the python3Packages prefix.

propagatedBuildInputs = with python3Packages; [
six diff-match-patch lxml python-Levenshtein chardet pycountry
];
checkInputs = with python3Packages; [ pytest ];
Copy link
Member

Choose a reason for hiding this comment

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

This would make building against python2 impossible. Please move all libraries into the header and remove the python3Packages.

{ stdenv, fetchFromGitHub, python3Packages, makeWrapper, six, diff-match-patch, ... }:

@Mic92
Copy link
Member

Mic92 commented Oct 12, 2017

Packages which can be used as both stay in python-packages.nix. However we sometimes add a reference from all-packages.nix:

translate-toolkit = python3Packages.translate-tookit;

@phile314
Copy link
Contributor Author

phile314 commented Nov 5, 2017

The translate-toolkit is now a normal python library. I added a reference in all-packages.nix as suggested as it also contains some useful executables. Also rebased & squashed on current master.

@jtojnar
Copy link
Contributor

jtojnar commented Feb 2, 2018

Could you actually move the package to pkgs/development/python-modules/translate-toolkit and then use callPackage inside python-packages.nix?

@@ -20710,6 +20710,36 @@ in {

transaction = callPackage ../development/python-modules/transaction { };

translate-toolkit = 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.

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

@Ekleog
Copy link
Member

Ekleog commented Oct 18, 2018

(triage) @phile314, are you still willing to push this forward?

@jtojnar
Copy link
Contributor

jtojnar commented Oct 18, 2018

I am actually working on this (packaging weblate).

@phile314
Copy link
Contributor Author

Feel free to take over or close this, I no longer have the time to push this.

@FRidh
Copy link
Member

FRidh commented Oct 20, 2018

@jtojnar please open a new PR with your version.

@FRidh FRidh closed this Oct 20, 2018
@jtojnar
Copy link
Contributor

jtojnar commented Oct 20, 2018

See #48726

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

5 participants