Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/applications/editors/jetbrains/bin/ides.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@
"homepage": "https://www.jetbrains.com/pycharm/"
}
},
"pycharm-professional": {
"pycharm": {
"product": "PyCharm",
"productShort": "PyCharm",
"wmClass": "jetbrains-pycharm",
"meta": {
"isOpenSource": false,
"description": "Paid-for Python IDE from JetBrains",
"description": "Python IDE from JetBrains",
"maintainers": [ "genericnerdyusername", "tymscar" ],
"longDescription": "Python IDE with complete set of tools for productive development with Python programming language. In addition, the IDE provides high-class capabilities for professional Web development with Django framework and Google App Engine. It has powerful coding assistance, navigation, a lot of refactoring features, tight integration with various Version Control Systems, Unit testing, powerful all-singing all-dancing Debugger and entire customization. PyCharm is developer driven IDE. It was developed with the aim of providing you almost everything you need for your comfortable and productive development!",
"homepage": "https://www.jetbrains.com/pycharm/"
Expand Down
25 changes: 13 additions & 12 deletions pkgs/applications/editors/jetbrains/bin/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@
"url": "https://download.jetbrains.com/python/pycharm-community-2025.1.1.tar.gz",
"build_number": "251.25410.122"
},
"pycharm-professional": {
"pycharm": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}.tar.gz",
"url-template": "https://download.jetbrains.com/python/pycharm-{version}.tar.gz",
"version": "2025.1.1",
"sha256": "b1e8660b1c947f3bb746d0736e1e9c247635fadedb52f230ef5c64862893ad0b",
"url": "https://download.jetbrains.com/python/pycharm-professional-2025.1.1.tar.gz",
"url": "https://download.jetbrains.com/python/pycharm-2025.1.1.tar.gz",
"build_number": "251.25410.122"
},
"rider": {
Expand Down Expand Up @@ -228,12 +228,12 @@
"url": "https://download.jetbrains.com/python/pycharm-community-2025.1.1-aarch64.tar.gz",
"build_number": "251.25410.122"
},
"pycharm-professional": {
"pycharm": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}-aarch64.tar.gz",
"url-template": "https://download.jetbrains.com/python/pycharm-{version}-aarch64.tar.gz",
"version": "2025.1.1",
"sha256": "3f8f8a3773652ec99ea7a05b55dff41b5683548838f009e5e3d132ea644384d9",
"url": "https://download.jetbrains.com/python/pycharm-professional-2025.1.1-aarch64.tar.gz",
"url": "https://download.jetbrains.com/python/pycharm-2025.1.1-aarch64.tar.gz",
"build_number": "251.25410.122"
},
"rider": {
Expand Down Expand Up @@ -367,12 +367,12 @@
"url": "https://download.jetbrains.com/python/pycharm-community-2025.1.1.dmg",
"build_number": "251.25410.122"
},
"pycharm-professional": {
"pycharm": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}.dmg",
"url-template": "https://download.jetbrains.com/python/pycharm-{version}.dmg",
"version": "2025.1.1",
"sha256": "cd56a7e1072f4562e2d3ef67e70f227606376572634120170f5689d3b970b570",
"url": "https://download.jetbrains.com/python/pycharm-professional-2025.1.1.dmg",
"url": "https://download.jetbrains.com/python/pycharm-2025.1.1.dmg",
"build_number": "251.25410.122"
},
"rider": {
Expand Down Expand Up @@ -506,12 +506,12 @@
"url": "https://download.jetbrains.com/python/pycharm-community-2025.1.1-aarch64.dmg",
"build_number": "251.25410.122"
},
"pycharm-professional": {
"pycharm": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}-aarch64.dmg",
"url-template": "https://download.jetbrains.com/python/pycharm-{version}-aarch64.dmg",
"version": "2025.1.1",
"sha256": "76a97e0d1ca75cbfbcc0acb046154daec1113010c052318077a128ff89fb55a6",
"url": "https://download.jetbrains.com/python/pycharm-professional-2025.1.1-aarch64.dmg",
"url": "https://download.jetbrains.com/python/pycharm-2025.1.1-aarch64.dmg",
"build_number": "251.25410.122"
},
"rider": {
Expand Down Expand Up @@ -556,3 +556,4 @@
}
}
}

58 changes: 48 additions & 10 deletions pkgs/applications/editors/jetbrains/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
let
# `ides.json` is handwritten and contains information that doesn't change across updates, like maintainers and other metadata
# `versions.json` contains everything generated/needed by the update script version numbers, build numbers and tarball hashes

# TODOs for ./bin/ides.json:
# - pycharm-community can be removed once pycharm-src is available.
# - pycharm MAYBE can be set to `isOpenSource = true` once we know how to build it.
# - It is however unlikely that the bin version provided by Jetbrains is ACTUALLY open source. As of now it contains propreitary bundled plugins
# at least. Instead we probably need to keep it as `isOpenSource = false` but change the build so that all source builds are always asumed to be OSS.
ideInfo = builtins.fromJSON (builtins.readFile ./bin/ides.json);
# TODOs for ./bin/versions.json:
# - pycharm-community can be removed once pycharm-src is available.
versions = builtins.fromJSON (builtins.readFile ./bin/versions.json);
in

{
config,
lib,
stdenv,
callPackage,
Expand Down Expand Up @@ -155,6 +164,20 @@ let
}
);

# TODO: These should be moved down again once we throw instead of warn in the deprecated aliases

pycharm-bin = buildPycharm {
pname = "pycharm";
extraBuildInputs = [ musl ];
};
# TODO: To be defined once Jetbrains provides PyCharm source builds.
#pycharm-src = buildPycharm {
# pname = "pycharm";
# extraBuildInputs = [ musl ];
# fromSource = true;
#};
# TODO - see above, should then be: pycharm = if stdenv.hostPlatform.isDarwin then pycharm-bin else pycharm-src;
pycharm = pycharm-bin;
in
rec {
# Sorted alphabetically
Expand Down Expand Up @@ -304,21 +327,28 @@ rec {
];
};

pycharm-community-bin = buildPycharm { pname = "pycharm-community"; };
inherit pycharm pycharm-bin; # TODO: Add pycharm-src once Jetbrains provides way to build PyCharm from source.

pycharm-community-src = buildPycharm {
pname = "pycharm-community";
fromSource = true;
};
# TODO: Replace with alias (see bottom) once pycharm-src is available.
pycharm-community-bin =
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 pass CI if you only define these if config.allowAliases is true.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see the commented out block below. Don't think there is a way to have a soft warning, unfortunately.

lib.warnOnInstantiate
"PyCharm has been unified into a single product and PyCharm Community has been discontinued. This package will be replaced with jetbrains.pycharm-bin soon, once Jetbrains provides a way to build PyCharm from source. Until then updates may not be provided and plugins from nixpkgs may not work. You can use `jetbrains.pycharm-bin` in the meantime."
(buildPycharm {
pname = "pycharm-community";
});

# TODO: Replace with alias (see bottom) once pycharm-src is available.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this TODO comment implying there is no way for a user to "resolve" the warning on their end? (At least, without switching to the -bin package)

If so, I would hold off on adding the warning until we can add an alias, then use the alias itself as the trigger for the warning.

Unless it is possible that pycharm-src will never be available, in which case I'd move the entire package into the allowAliases set, and consider it "deprecated".

Note: that allowAliases is used for deprecated, renamed, and removed packages; not just actual aliases.

pycharm-community-src =
lib.warnOnInstantiate
"PyCharm has been unified into a single product and PyCharm Community has been discontinued. This package will be replaced with jetbrains.pycharm-src soon, once Jetbrains provides a way to build PyCharm from source. Until then updates may not be provided and plugins from nixpkgs may not work. You can use `jetbrains.pycharm-bin` in the meantime."
(buildPycharm {
pname = "pycharm-community";
fromSource = true;
});

pycharm-community =
if stdenv.hostPlatform.isDarwin then pycharm-community-bin else pycharm-community-src;

pycharm-professional = buildPycharm {
pname = "pycharm-professional";
extraBuildInputs = [ musl ];
};

rider =
(mkJetBrainsProduct {
pname = "rider";
Expand Down Expand Up @@ -431,3 +461,11 @@ rec {
};

}
// lib.optionalAttrs config.allowAliases {
# PyCharm Community is discontinued and PyCharm Professional renamed to PyCharm - Added 2025-06-01
# TODO: Enable once Jetbrains provides a way to build PyCharm from source.
#pycharm-community = lib.warnOnInstantiate "PyCharm has been unified into a single product and PyCharm Community has been discontinued. This deprecated alias now provides the new PyCharm (formerly Professional), you may be asked to migrate your settings. Please use jetbrains.pycharm instead. On Linux you can for now still build PyCharm Community from source using jetbrains.pycharm-community-src." pycharm;
#pycharm-community-bin = lib.warnOnInstantiate "PyCharm has been unified into a single product and PyCharm Community has been discontinued. This deprecated alias now provides the new PyCharm (formerly Professional), you may be asked to migrate your settings. Please use jetbrains.pycharm-bin instead." pycharm-bin;
#pycharm-community-src = lib.warnOnInstantiate "PyCharm has been unified into a single product and PyCharm Community has been discontinued. This deprecated alias now provides the new PyCharm (formerly Professional), you may be asked to migrate your settings. Please use jetbrains.pycharm-src instead." pycharm-src;
pycharm-professional = lib.warnOnInstantiate "PyCharm has been unified into a single product and PyCharm Professional has been renamed. Please use jetbrains.pycharm-bin instead." pycharm-bin;
}
7 changes: 6 additions & 1 deletion pkgs/applications/editors/jetbrains/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ let

selectFile =
id: ide: build:
if !builtins.elem ide pluginsJson.plugins."${id}".compatible then
let
# Allow all PyCharm plugins for PyCharm Community - TODO: Remove this special case once PyCharm Community is removed
pycharmCommunityCheck =
id != "pycharm-community" || builtins.elem ide pluginsJson.plugins.pycharm.compatible;
in
if !pycharmCommunityCheck && !builtins.elem ide pluginsJson.plugins."${id}".compatible then
throw "Plugin with id ${id} does not support IDE ${ide}"
else if !pluginsJson.plugins."${id}".builds ? "${build}" then
throw "Jetbrains IDEs with build ${build} are not in nixpkgs. Try update_plugins.py with --with-build?"
Expand Down
Loading
Loading