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

mathics: init at 1.1.1 #107652

Closed
wants to merge 1 commit into from
Closed

mathics: init at 1.1.1 #107652

wants to merge 1 commit into from

Conversation

suhr
Copy link
Contributor

@suhr suhr commented Dec 26, 2020

Motivation for this change

Mathics is back. This PR adds mathics at version 1.1.1, released just three days ago.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@rmcgibbo
Copy link
Contributor

Result of nixpkgs-review pr 107652 1

1 package built:
  • mathics

@collares
Copy link
Member

collares commented Jan 5, 2021

Besides the package, the NixOS module was also removed in #95505. If it's easy, reverting it could be useful? Not sure if people use the notebook server.

@suhr
Copy link
Contributor Author

suhr commented Jan 5, 2021

In this PR I want to add only the package.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 107652 run on x86_64-linux 1

1 package built:
  • mathics

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Jan 8, 2021

Result of nixpkgs-review pr 107652 run on x86_64-darwin 1

1 package failed to build:
  • mathics
/nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/multiprocessing/context.py:224: in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
/nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/multiprocessing/context.py:284: in _Popen
    return Popen(process_obj)
/nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/multiprocessing/popen_spawn_posix.py:32: in __init__
    super().__init__(process_obj)
/nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/multiprocessing/popen_fork.py:19: in __init__
    self._launch(process_obj)
/nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/multiprocessing/popen_spawn_posix.py:47: in _launch
    reduction.dump(process_obj, fp)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

obj = <Process name='Process-1' parent=27042 initial>
file = <_io.BytesIO object at 0x111f9adb0>, protocol = None

    def dump(obj, file, protocol=None):
        '''Replacement for pickle.dump() using ForkingPickler.'''
>       ForkingPickler(file, protocol).dump(obj)
E       AttributeError: Can't pickle local object 'test_multiprocessing.<locals>.sync_process'

/nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/multiprocessing/reduction.py:60: AttributeError
=============================== warnings summary ===============================
tests/test_sync.py::test_sync_to_async
  /private/tmp/nix-build-python3.8-asgiref-3.3.1.drv-0/source/tests/test_sync.py:45: DeprecationWarning: Using the default executor that is not an instance of ThreadPoolExecutor is deprecated and will be prohibited in Python 3.9
    loop.set_default_executor(old_executor)

tests/test_sync.py::test_sync_to_async_method_decorator
  /nix/store/cf88yvm21kwal2bvgk8pgyjsbw3v0ixj-python3-3.8.6/lib/python3.8/socket.py:573: RuntimeWarning: coroutine 'test_stateless_server.<locals>.app' was never awaited
    b = socket(family, type, proto, b.detach())

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_sync.py::test_multiprocessing - AttributeError: Can't pickl...
=================== 1 failed, 45 passed, 2 warnings in 7.97s ===================
builder for '/nix/store/w205iyhh4zgrchzq6xcihkgakf67cgd9-python3.8-asgiref-3.3.1.drv' failed with exit code 1
cannot build derivation '/nix/store/rnajanby6yib8j04ryhrnrjbbpk1399i-python3-3.8.6-env.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/apsjmgss9hhx4pdqkj12n5kgh2nwrk25-python3.8-Django-3.1.5.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vdni85y07sl4cym5bsp0p323dgspilyd-mathics-1.1.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/vdni85y07sl4cym5bsp0p323dgspilyd-mathics-1.1.1.drv' failed

Can you disable that test for darwin?

@suhr
Copy link
Contributor Author

suhr commented Jan 8, 2021

Added platforms = platforms.linux.

done
'';

disabled = !isPy3k;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
disabled = !isPy3k;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is python 3 only software.

Copy link
Member

Choose a reason for hiding this comment

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

See next suggestion.

in
buildPythonApplication rec {
pname = "mathics";
version = "1.1.1";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version = "1.1.1";
version = "1.1.1";
disabled = !isPy3k;

pkgs/applications/science/math/mathics/default.nix Outdated Show resolved Hide resolved
SANDBOX=true python mathics/test.py --keep-going
for manage in $(find $out -name manage.py); do
chmod +x $manage
wrapProgram $manage --set PYTHONPATH "$PYTHONPATH:${pythonEnv}/${pythonEnv.sitePackages}"
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if there is a better way to do this.

@collares
Copy link
Member

Added platforms = platforms.linux.

Does it build on Darwin now with #108876? If so, is this ready to land (without platforms = platforms.linux, of course)?

@suhr
Copy link
Contributor Author

suhr commented Feb 18, 2021

Let's try out. I removed platforms = platforms.linux.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 107652 run on x86_64-darwin 1

1 package built:
  • mathics

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

mathics:

URI literals are deprecated.
Near pkgs/applications/science/math/mathics/default.nix:49:18:

   |
49 |       homepage = https://mathics.github.io/;
   |                  ^

See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/no-uri-literals.md

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 107652 run on x86_64-linux 1

1 package failed to build and are new build failure:

@collares
Copy link
Member

This PR is cursed :P The failure is probably fixed by importing this patch: mathics/Mathics@ec5bde2

@suhr
Copy link
Contributor Author

suhr commented Feb 19, 2021

I should probably update this to 2.0.0 anyway, will do it later.

@stale
Copy link

stale bot commented Aug 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 21, 2021
@suhr suhr closed this Aug 21, 2021
@suhr suhr deleted the mathics branch August 21, 2021 10:45
@YoshiRulz
Copy link
Contributor

I'd love for you to revisit this. I tried to package Mathics 5.0.2 in an overlay, but it crashes on startup with:

[...]
  File "/nix/store/l9nqch01gipc4aypkc4n2nvlvjxvcqpi-mathics-5.0.2/lib/python3.9/site-packages/mathics/core/parser/parser.py", line 147, in parse_p
    return method(token)
  File "/nix/store/l9nqch01gipc4aypkc4n2nvlvjxvcqpi-mathics-5.0.2/lib/python3.9/site-packages/mathics/core/parser/parser.py", line 296, in p_RawLeftBrace
    self.expect("RawRightBrace")
  File "/nix/store/l9nqch01gipc4aypkc4n2nvlvjxvcqpi-mathics-5.0.2/lib/python3.9/site-packages/mathics/core/parser/parser.py", line 93, in expect
    raise InvalidSyntaxError()
mathics_scanner.errors.InvalidSyntaxError
final: prev: let
	recordclass = prev.python3Packages.buildPythonPackage rec {
		pname = "recordclass";
		version = "0.18.0.1";
		src = prev.python3Packages.fetchPypi {
			inherit pname version;
			sha256 = "sha256-8HZ6bcWzgRgHTsWv11lt0EpsyZKJT0DuzfS1hzFc5GU=";
		};
		doCheck = false;
	};
	mathicsScanner = prev.python3Packages.buildPythonPackage {
		pname = "mathics-scanner";
		version = "1.2.4";
		src = prev.fetchFromGitHub {
			owner = "Mathics3";
			repo = "mathics-scanner";
			rev = "1.2.4";
			hash = "sha256-ZdkIvoINbw6MXXOqHy4XKGyOuvDVyWsYufRv2XU+DFg=";
		};
		propagatedBuildInputs = builtins.attrValues {
			inherit (final.python3Packages) chardet click pyyaml;
		};
		doCheck = false;
	};
in {
	mathics = let
		deps = builtins.attrValues {
			inherit (final.python3Packages) dateutil llvmlite numpy palettable pint requests setuptools sympy;
			inherit mathicsScanner recordclass;
		};
		pythonEnv = final.python.withPackages (p: deps);
	in prev.python3Packages.buildPythonApplication {
		pname = "mathics";
		version = "5.0.2";
		src = prev.fetchFromGitHub {
			owner = "Mathics3";
			repo = "mathics-core";
			rev = "5.0.2";
			hash = "sha256-EnRrI44dD+tYh+RpCzx2q77cU5aoUFi/ETEqQmBxBF0=";
		};
		propagatedBuildInputs = deps;
		doCheck = false;
		meta = {
			description = "FOSS Mathematica clone";
			homepage = "https://mathics.github.io/";
			license = prev.lib.licenses.gpl3Only;
		};
	};
}

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