Giter Club home page Giter Club logo

nix-prefetch-github's Introduction

nix-prefetch-github

Introduction

This module implements a python function and a command line tool to help you fetch sources from github when using fetchFromGitHub.

This program can be distributed under the conditions of the GNU Public License Version 3. Check out LICENSE.txt to read the license text.

Command Line Example

result/bin/nix-prefetch-github seppeljordan nix-prefetch-github
{
    "owner": "seppeljordan",
    "repo": "nix-prefetch-github",
    "rev": "0b35faf8532781cb0e36dcdd73273bff4eef1396",
    "hash": "sha256-oIR2iEiOBQ1VKouJTLqEiWWNzrMSJcnxK+m/j9Ia/m8="
}

Available Commands

nix-prefetch-github

This command downloads the code from a github repository and puts it into the local nix store. It also prints the function arguments to fetchFromGitHub to the standard output. :

usage: nix-prefetch-github [-h] [--fetch-submodules] [--no-fetch-submodules]
			      [--leave-dot-git] [--no-leave-dot-git]
			      [--deep-clone] [--no-deep-clone] [--verbose]
			      [--nix] [--json] [--version] [--rev REV]
			      owner repo

positional arguments:
  owner
  repo

options:
  -h, --help            show this help message and exit
  --fetch-submodules    Include git submodules in the output derivation
  --no-fetch-submodules
			   Don't include git submodules in output derivation
  --leave-dot-git       Include .git folder in output derivation. Use this if
			   you need repository data, e.g. current commit hash,
			   for the build process.
  --no-leave-dot-git    Don't include .git folder in output derivation.
  --deep-clone          Include all of the repository history in the output
			   derivation. This option implies --leave-dot-git.
  --no-deep-clone       Don't include the repository history in the output
			   derivation.
  --verbose, -v         Print additional information about the programs
			   execution. This is useful if you want to issue a bug
			   report.
  --nix                 Output the results as valid nix code.
  --json                Output the results in the JSON format
  --version             show program's version number and exit
  --rev REV

nix-prefetch-github-directory

This command examins the current working directory and tries to figure out if it is part of a git repository linked to github. If this was successful the program prefetches the currently checked out commit from the origin remote repository similar to the command nix-prefetch-github.

usage: .nix-prefetch-github-directory-wrapped [-h] [--fetch-submodules]
						 [--no-fetch-submodules]
						 [--leave-dot-git]
						 [--no-leave-dot-git]
						 [--deep-clone] [--no-deep-clone]
						 [--verbose] [--nix] [--json]
						 [--version]
						 [--directory DIRECTORY]
						 [--remote REMOTE]

options:
  -h, --help            show this help message and exit
  --fetch-submodules    Include git submodules in the output derivation
  --no-fetch-submodules
			   Don't include git submodules in output derivation
  --leave-dot-git       Include .git folder in output derivation. Use this if
			   you need repository data, e.g. current commit hash,
			   for the build process.
  --no-leave-dot-git    Don't include .git folder in output derivation.
  --deep-clone          Include all of the repository history in the output
			   derivation. This option implies --leave-dot-git.
  --no-deep-clone       Don't include the repository history in the output
			   derivation.
  --verbose, -v         Print additional information about the programs
			   execution. This is useful if you want to issue a bug
			   report.
  --nix                 Output the results as valid nix code.
  --json                Output the results in the JSON format
  --version             show program's version number and exit
  --directory DIRECTORY
  --remote REMOTE

nix-prefetch-github-latest-release

This command fetches the code for the latest release of the specified repository.

usage: nix-prefetch-github-latest-release [-h] [--fetch-submodules]
					     [--no-fetch-submodules]
					     [--leave-dot-git]
					     [--no-leave-dot-git] [--deep-clone]
					     [--no-deep-clone] [--verbose]
					     [--nix] [--json] [--version]
					     owner repo

positional arguments:
  owner
  repo

options:
  -h, --help            show this help message and exit
  --fetch-submodules    Include git submodules in the output derivation
  --no-fetch-submodules
			   Don't include git submodules in output derivation
  --leave-dot-git       Include .git folder in output derivation. Use this if
			   you need repository data, e.g. current commit hash,
			   for the build process.
  --no-leave-dot-git    Don't include .git folder in output derivation.
  --deep-clone          Include all of the repository history in the output
			   derivation. This option implies --leave-dot-git.
  --no-deep-clone       Don't include the repository history in the output
			   derivation.
  --verbose, -v         Print additional information about the programs
			   execution. This is useful if you want to issue a bug
			   report.
  --nix                 Output the results as valid nix code.
  --json                Output the results in the JSON format
  --version             show program's version number and exit

development environment

Use nix develop with flake support enabled. Development without nix flake support is not officially supported. Run the provided tests via pytest. You can control what kind of tests are run via the variable DISABLED_TESTS:

# Only run tests that don't hit network and don't use nix
DISABLED_TESTS="network requires_nix_build" pytest

Currently network and requires_nix_build are the only values that make sense with this environment variable.

You can visualize the dependency graph of the individual python modules via the ./generate-dependency-graph program.

You can generate a coverage report for the tests via

coverage run -m nix_prefetch_github.run_tests && coverage html

changes

v7.0.0

  • The output format changed. In previous versions the json and nix output included sha256 as a field. This field was removed in favour of a hash field. The value of this field is an SRI hash.

v6.0.1

  • Fix bug in repository detection for nix-prefetch-github-directory

v6.0.0

  • Drop support for python3.8
  • Drop default arguments to fetchFromGitHub from json output (e.g. leaveDotGit = false;, fetchSubmodule = false;, deepClone = false;)

v5.2.2

  • Add more info to error messages

v5.2.1

  • Fixed a bug that broke the program for users without the experimental `nix-command` feature

v5.2.0

  • Emit warning if unsafe options –deep-clone and –leave-dot-git are used.
  • Improve –help output slightly
  • Declutter verbose logging output

v5.1.2

  • Use old prefetch implementation because of bug in nix-prefetch-git. See this github issue

v5.1.1

  • Fix bug that broke nix-prefetch-github --version

v5.1.0

  • Use nix-prefetch-git and nix-prefetch-url for calculating sha256 sums when possible. The application will fall back to the old method when nix-prefetch-* are not available.

v5.0.1

  • Fix breaking bug in hash generation

v5.0.0

  • Remove all dependencies to other python packages other than “core” ones
  • Allow users to control debugging output via the --verbosity cli option
  • All commands now understand --fetch-submodules and --no-fetch-submodules options
  • Commands now understand --leave-dot-git and --no-leave-dot-git options
  • Commands now understand --deep-clone and --no-deep-clone

v4.0.4

  • Print standard error output of subprocesses for better debugging

v4.0.3

  • Generated hashes now don’t have a “sha256-” prefix
  • jinja2 is no longer a dependency of nix-prefetch-github

v4.0.2

  • packaging release, no bugfixes or features

v4.0.1

  • Fix issue #38

v4.0

  • Make fetching submodules the default in calls to python routines. The CLI should be uneffected by this change.
  • Remove default values for fetch_submodules in all internal classes.
  • Implement nix-prefetch-github-latest-release command

v3.0

  • major changes to the internal module structure
  • introduction of the nix-prefetch-github-directory command
  • code repository now functions as a nix flake

v2.4

  • added --fetch-submodules flag
  • Fixed incompability with nix 2.4

v2.3.2

  • fix issues #21, #22
  • nix-prefetch-github now accepts full ref names, e.g. refs/heads/master which was broken since 2.3 (#23)

v2.3.1

  • Fix bug in generated nix expression
  • Fix bug that prevented targeting tags with prefetch command
  • Improve error message format in case revision is not found

v2.3

  • Remove dependency to requests
  • Default to master branch instead of first branch in list

v2.2

  • Add --version flag
  • Fix bug in output formatting

v2.1

  • Fix bug (#4) that made nix-prefetch-github incompatible with nix 2.2.

v2.0

  • The result of nix_pretch_github and its corresponding command line tool now contains always the actual commit hash as detected by the tool instead of the branch or tag name.
  • Add a new flag --nix that makes the command line tool output a valid nix expression
  • Removed the --hash-only and --no-hash-only flags and changed add --prefetch and --no-prefetch flags to replace them.

nix-prefetch-github's People

Contributors

hraban avatar klntsky avatar mkg20001 avatar seppeljordan avatar supersandro2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nix-prefetch-github's Issues

Using a tag as the --rev argument

I used to pass tag names in the --rev command line argument, but this is no longer working. If I track down the corresponding hash for the tag and use that, nix-prefetch-github still works. Using the tag name still works in fetchFromGitHub. Here is an example of a failure:

$ nix-prefetch-github RadeonOpenCompute ROCm-CompilerSupport --rev roc-2.6.0
Traceback (most recent call last):
  File "/nix/store/bd07n8il3wr9zw8d0h6dkca4i6r4ncha-nix-prefetch-github-2.3/bin/.nix-prefetch-github-wrapped", line 11, in <module>
    sys.exit(_main())
  File "/nix/store/8ls7pdjgrfy309pmg6lqqr5wi8b9m601-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/nix/store/8ls7pdjgrfy309pmg6lqqr5wi8b9m601-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/nix/store/8ls7pdjgrfy309pmg6lqqr5wi8b9m601-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/8ls7pdjgrfy309pmg6lqqr5wi8b9m601-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/nix/store/bd07n8il3wr9zw8d0h6dkca4i6r4ncha-nix-prefetch-github-2.3/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 212, in _main
    output_dictionary = nix_prefetch_github(owner, repo, prefetch, rev)
  File "/nix/store/bd07n8il3wr9zw8d0h6dkca4i6r4ncha-nix-prefetch-github-2.3/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 197, in nix_prefetch_github
    return sync_perform(dispatcher(), main_intent())
  File "/nix/store/alyh38wxqsl18y0cpd0c8nkzsqhf2487-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/_sync.py", line 34, in sync_perform
    six.reraise(*errors[0])
  File "/nix/store/vswrwlavw387mp7cb6z3jrb2vxqbgpz2-python3.7-six-1.12.0/lib/python3.7/site-packages/six.py", line 693, in reraise
    raise value
  File "/nix/store/alyh38wxqsl18y0cpd0c8nkzsqhf2487-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/_base.py", line 78, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/alyh38wxqsl18y0cpd0c8nkzsqhf2487-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/do.py", line 120, in <lambda>
    return val.on(success=lambda r: _do(r, generator, False),
  File "/nix/store/alyh38wxqsl18y0cpd0c8nkzsqhf2487-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/do.py", line 100, in _do
    val = generator.send(result)
  File "/nix/store/bd07n8il3wr9zw8d0h6dkca4i6r4ncha-nix-prefetch-github-2.3/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 191, in main_intent
    "rev": prefetch_results['rev'],
TypeError: 'NoneType' object is not subscriptable

Improve error message "Unable to locate revision"

nix-prefetch-github XTLS xray I expected to work, but I don't know why it gives me

Prefetch failed: Unable to locate revision

I don't know what that means

EDIT: I had a typo in the name of the github repo, should be Xray-core, just the error message is confusing

How it supposed to work?

nix-shell -p nix gitMinimal nix-prefetch-github -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable-small.tar.gz --pure --run 'nix-prefetch-github --nix --rev refs/heads/nixos-unstable nixos nixpkgs'
Traceback (most recent call last):
  File "/nix/store/w4j2paga2c32fks9viwr06l4m12accg4-nix-prefetch-github-2.2/bin/.nix-prefetch-github-wrapped", line 11, in <module>
    sys.exit(_main())
  File "/nix/store/jl77hjkh5xmg41v74iyj34hrfp84j41i-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/nix/store/jl77hjkh5xmg41v74iyj34hrfp84j41i-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/nix/store/jl77hjkh5xmg41v74iyj34hrfp84j41i-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/jl77hjkh5xmg41v74iyj34hrfp84j41i-python3.7-click-7.0/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/nix/store/w4j2paga2c32fks9viwr06l4m12accg4-nix-prefetch-github-2.2/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 213, in _main
    output_dictionary = nix_prefetch_github(owner, repo, prefetch, rev)
  File "/nix/store/w4j2paga2c32fks9viwr06l4m12accg4-nix-prefetch-github-2.2/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 198, in nix_prefetch_github
    return sync_perform(dispatcher(), main_intent())
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/_sync.py", line 34, in sync_perform
    six.reraise(*errors[0])
  File "/nix/store/468n8kmifbp5nwbgz4r91ivnwxsnz9cc-python3.7-six-1.12.0/lib/python3.7/site-packages/six.py", line 693, in reraise
    raise value
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/_base.py", line 78, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/do.py", line 121, in <lambda>
    error=lambda e: _do(e, generator, True))
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/do.py", line 98, in _do
    val = generator.throw(*result)
  File "/nix/store/w4j2paga2c32fks9viwr06l4m12accg4-nix-prefetch-github-2.2/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 187, in main_intent
    rev=rev
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/_base.py", line 78, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/do.py", line 120, in <lambda>
    return val.on(success=lambda r: _do(r, generator, False),
  File "/nix/store/nnxyvqfvd073fj4hhgflvms5jajnm6rn-python3.7-effect-0.12.0/lib/python3.7/site-packages/effect/do.py", line 100, in _do
    val = generator.send(result)
  File "/nix/store/w4j2paga2c32fks9viwr06l4m12accg4-nix-prefetch-github-2.2/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 164, in prefetch_github
    ).format(owner=owner, repo=repo, output=output)
NameError: name 'output' is not defined

Error messages printed to stdout instead of stderr

Cause majors headaches (script exiting when stdout is assigned to variables in bash scripts in set -e mode.

$ nix-prefetch-github --rev doesnotexists seppeljordan nix-prefetch-github
Revision doesnotexists not found for repository seppeljordan/nix-prefetch-github

$ 1>/dev/null nix-prefetch-github --rev doesnotexists seppeljordan nix-prefetch-github
# Nothing here, expected the error message.

$ my_output="$(nix-prefetch-github --rev doesnotexists seppeljordan nix-prefetch-github)"
# Nothing here, expected the error message.
# The script exits silently.

return "Revision {revision} not found for repository {owner}/{repo}".format(

message=revision_not_found_errormessage(

Fetch latest release

Currently (afaik) nix-prefetch-github just probes the latest commit and generates output for that commit.
I'd like to have a flag to fetch the latest release to avoid a manual round trip to the github api.

Add flag to write latest release tag as a field/variable to output json/nix.

With nix-prefetch-github-latest-release we get the commit hash and the correct source for the latest release, but we still have to update a packages version manually, or do more work to automate it.

As an example:

export VERSION=$( curl \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | jq -r '.tag_name' )

I use this and then sed the the version.nix file, if we could get a nice clean json file containing the tag as well, it would be more straight forward to then just use lib.importJSON.

Please propagate error messages from subprocesses

NOTE: for someone coming here to find out how to use nix-prefetch-github in a pure shell:

nix-shell -I nixpkgs=channel:nixos-unstable --pure -p git cacert nix nix-prefetch-github --run "env NIX_PATH=$NIX_PATH nix-prefetch-github OWNER REPO"

Please do something about propagating errors from internal exec calls.

Running nix-prefetch-github in a --pure shell causes nix-build to fail with:

$ nix-shell -I nixpkgs=channel:nixos-unstable --pure -p cacert git nix nix-prefetch-github --run "nix-prefetch-github WikidPad WikidPad"
Internal Error: Calculate hash value for sources in github repo WikidPad/WikidPad.

The style of the nix-prefetch-github code is not typical, and appears more difficult to debug than usual.
I imagine most issues are with the environment, and not the code, so propagating information from exec-ed binaries, and their calling arguments, would probably cover most issues, and reporters could diagnose things themselves.

There are several specific problems as you go through the paces of constructing the command:

missing git

$ nix-shell -I nixpkgs=channel:nixos-unstable --pure -p nix-prefetch-github --run "nix-prefetch-github WikidPad WikidPad" > master.json
Traceback (most recent call last):          
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/bin/.nix-prefetch-github-wrapped", line 9, in <module>
    sys.exit(main())             
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 829, in __call__                                                
    return self.main(*args, **kwargs) 
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 782, in main          
    rv = self.invoke(ctx)               
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke                                                 
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)            
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/__main__.py", line 42, in main
    prefetched_repository = nix_prefetch_github(                                                                       
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/public.py", line 20, in nix_prefetch_github
    return perform_effects(                                                                                            
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 215, in perform_effects
    return sync_perform(dispatcher(), effects)
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 31, in sync_perform
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 31, in sync_perform
    raise errors[0]
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/core/prefetch.py", line 38, in prefetch_github
    yield self._detect_revision()
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/core/prefetch.py", line 64, in _detect_revision
    actual_rev = yield self._revision_index.get_revision_from_name(
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/core/revision.py", line 13, in get_revision_from_name
    list_remote = yield Effect(GetListRemote(repository=self._repository))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 69, in sync_wrapper
    box.succeed(f(*pass_args, **kwargs))
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 50, in _performer
    return sync_perform(dispatcher, effect(intent))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 31, in sync_perform
    raise errors[0]
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 145, in get_list_remote_performer
    returncode, stdout = yield Effect(
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 69, in sync_wrapper
    box.succeed(f(*pass_args, **kwargs))
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 203, in execute_command_performer
    process_return = subprocess.run(
  File "/nix/store/4s0h5aawbap3xhldxhcijvl26751qrjr-python3-3.8.9/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/nix/store/4s0h5aawbap3xhldxhcijvl26751qrjr-python3-3.8.9/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/4s0h5aawbap3xhldxhcijvl26751qrjr-python3-3.8.9/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git'

This is fine, because it tells you what the problem is.

missing cacert

$ nix-shell -I nixpkgs=channel:nixos-unstable --pure -p git nix-prefetch-github --run "nix-prefetch-github WikidPad WikidPad" > master.json
Could not find a public repository named 'WikidPad' for user 'WikidPad' at github.com

This is not ok, but from experience one may know that cacert is missing.

missing nix-build

$ nix-shell -I nixpkgs=channel:nixos-unstable --pure -p cacert git nix-prefetch-github --run "nix-prefetch-github WikidPad WikidPad" > master.json
Traceback (most recent call last):                 
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/bin/.nix-prefetch-github-wrapped", line 9, in <module>   
    sys.exit(main())
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs) 
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 782, in main    
    rv = self.invoke(ctx)                   
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/2hdbkrisr351wry8cgh791kdx9mp11z5-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke                                               
    return callback(*args, **kwargs)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/__main__.py", line 42, in main
    prefetched_repository = nix_prefetch_github(
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/public.py", line 20, in nix_prefetch_github        
    return perform_effects(         
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 215, in perform_effects
    return sync_perform(dispatcher(), effects)  
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 31, in sync_perform
    raise errors[0]                                                                                                    
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))                                                                                 
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/core/prefetch.py", line 39, in prefetch_github
    yield self._calculate_sha256_sum()
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/core/prefetch.py", line 80, in _calculate_sha256_sum
    self._calculated_hash = yield Effect(
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 69, in sync_wrapper
    box.succeed(f(*pass_args, **kwargs))
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 50, in _performer
    return sync_perform(dispatcher, effect(intent))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 31, in sync_perform
    raise errors[0]
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 159, in calculate_sha256_sum
    return_code, nix_output = yield Effect(
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 69, in sync_wrapper
    box.succeed(f(*pass_args, **kwargs))
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 50, in _performer
    return sync_perform(dispatcher, effect(intent))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 31, in sync_perform
    raise errors[0]
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_base.py", line 71, in guard
    return (False, f(*args, **kwargs))
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 119, in <lambda>
    error=lambda e: _do(e, generator, True),
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/do.py", line 96, in _do
    val = generator.throw(result)
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 136, in try_prefetch_performer
    result = yield Effect(
  File "/nix/store/qxrjjv7i4w6s1iivxblzqwjw2c2pa0l8-python3.8-effect-1.1.0/lib/python3.8/site-packages/effect/_sync.py", line 69, in sync_wrapper
    box.succeed(f(*pass_args, **kwargs))
  File "/nix/store/v7zha1cmv3rmi6j6b7s6ys630pcax62s-python3.8-nix-prefetch-github-4.0.3/lib/python3.8/site-packages/nix_prefetch_github/effects.py", line 203, in execute_command_performer
    process_return = subprocess.run(
  File "/nix/store/4s0h5aawbap3xhldxhcijvl26751qrjr-python3-3.8.9/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/nix/store/4s0h5aawbap3xhldxhcijvl26751qrjr-python3-3.8.9/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/4s0h5aawbap3xhldxhcijvl26751qrjr-python3-3.8.9/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nix-build'

This is once again fine because it says nix-build is missing.

missing NIX_PATH

$ nix-shell -I nixpkgs=channel:nixos-unstable --pure -p cacert git nix nix-prefetch-github --run "nix-prefetch-github WikidPad WikidPad" > master.json
Internal Error: Calculate hash value for sources in github repo WikidPad/WikidPad.

This is not OK because it's entirely invisible what the problem is.

debugging note:

By running strace one can find the output, but I'm only listing this post-ex-facto after I already found what I was looking for by breakpointing using pudb (inducer/pudb#405 (comment)) and running nix-build with the appropriate arguments (e.g. ExecuteCommand(command=(["nix-build", nix_filename, "--no-out-link"])) -> nix-build /run/user/1000/tmp_lm4y7hj/prefetch-github.nix --no-out-link) :

$ nix-shell -I nixpkgs=channel:nixos-unstable --pure -p cacert git nix nix-prefetch-github strace --run "strace -v -s 1000 -f -e execve,read,write nix-prefetch-github WikidPad WikidPad"  |& less
...
[pid 21851] <... read resumed>"error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at /run/user/1000/tmpk3rwjqu8/prefetch-github.nix:2:17\n", 8192) = 146

Add more descriptive error messages

Thanks for such a convenient tool!

There is one small improvement that might be worth adding.
For example executing the following command:

nix-prefetch-github cinemast libjson-rpc-cpp --rev v1.2.0

results in getting the stack trace and error message that looks like this:

TypeError: 'NoneType' object is not subscriptable

Instead, it may be a good idea to have some high-level descriptive error message like
"the specified tag doesn't exist" or smth like that

Formatting test fails in nixpkgs when trying to update black

When trying to update black in nixpkgs the nix-prefetch-github build fails because the new version of black formats the code differently.

I wonder if there is a better way to handle this than disabling pytest-black by removing --black from addopts in setup.cfg when building in nixpkgs.

NixOS/nixpkgs#96456

=================================== FAILURES ===================================
______________________________ Black format check ______________________________
--- /build/nix-prefetch-github-4.0/build/lib/nix_prefetch_github/effect.py      2020-09-12 11:45:50 +0000
+++ /build/nix-prefetch-github-4.0/build/lib/nix_prefetch_github/effect.py      2020-11-08 03:48:55.101857 +0000
@@ -98,11 +98,14 @@
                 message=f"Remote '{intent.remote}' is not a link to a github repository"
             )
         )
     owner = match.group(2)
     name = match.group(3)
-    return GithubRepository(name=name, owner=owner,)
+    return GithubRepository(
+        name=name,
+        owner=owner,
+    )


 @do
 def detect_revision(intent):
     returncode, stdout = yield Effect(
@@ -213,11 +216,12 @@

 @do
 def check_git_repo_is_dirty_performer(intent):
     returncode, _ = yield Effect(
         ExecuteCommand(
-            command=["git", "diff", "HEAD", "--quiet"], cwd=intent.directory,
+            command=["git", "diff", "HEAD", "--quiet"],
+            cwd=intent.directory,
         )
     )
     if returncode == 128:
         raise Exception(
             f"Repository at {intent.directory} does not contain any commits"

rev different betwen nix-prefetch-git and prefetch-github

Hi, if I am running nix-prefetch-github --nix without specify --rev option, why the result is different from nix-prefetch-git command?

nix-prefetch-github seems prefetch old rev instead of newest like nix-prefetch-git did. Can you explain about this?Is this intended result from nix-prefetch-github?

Regression: No longer supports `--rev refs/heads/update-changelog` (full ref path)

$ nix-prefetch-github --version
nix-prefetch-github, version 2.3.1

$ nix-prefetch-github --rev refs/heads/update-changelog seppeljordan nix-prefetch-github
Revision refs/heads/update-changelog not found for repository seppeljordan/nix-prefetch-github

Was working fine in 2.2:

$ nix-prefetch-github --version
nix-prefetch-github, version 2.2

$ nix-prefetch-github --rev refs/heads/update-changelog seppeljordan nix-prefetch-github
{
    "owner": "seppeljordan",
    "repo": "nix-prefetch-github",
    "rev": "184aaaa2dc7cb22942393a2e08943ed15dd22f5e",
    "sha256": "03kk0a30wshya5zs94qn6548rpskfp7q6bx84nplslmy496qp9ys"
}

Output full SRI hashes (include `sha256-` prefix)

Currently nix-prefetch-github's output contains a raw base64'd sha256 hash:

$ nix-prefetch-github seppeljordan nix-prefetch-github
{
    "owner": "seppeljordan",
    "repo": "nix-prefetch-github",
    "rev": "50b4ccc03b03cc963d329e475f2b4c5ebf1dd178",
    "sha256": "YobBihNPbqYYWhe3x0p+BIlEK8R62s/dDFWUzP7fCTI=",
    "fetchSubmodules": false,
    "leaveDotGit": false,
    "deepClone": false
}

It would be ideal if nix-prefetch-github could include the SRI-style sha256- prefix in the hash, like sha256-YobBihNPbqYYWhe3x0p+BIlEK8R62s/dDFWUzP7fCTI=; this makes it clearer which kind of hash it is and more compatible with other tools (e.g. nix hash to-base32 YobBihNPbqYYWhe3x0p+BIlEK8R62s/dDFWUzP7fCTI= fails with error: hash 'YobBihNPbqYYWhe3x0p+BIlEK8R62s/dDFWUzP7fCTI=' does not include a type, nor is the type otherwise known from context).

Add option for fetching the repo in the working directory

At the moment I'm using something like this:

git remote get-url origin | 
  awk -F / '{print $(NF-1),"\t",$NF}' | 
  read owner repo && 
  nix-prefetch-github --prefetch --nix --rev $(git rev-parse HEAD) $owner $repo

It would be great to have this functionality built in with the necessary bells and whistles like warning about dirty files and being able to select a remote...

Regression: Fails when --rev is a branch or a tag containing the '/' character

See

_, kind, name = suffix.split('/')

In [4]: _, b, c = "refs/heads/my/branch".split('/')                                                                                                   
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-97c5e99b63b0> in <module>
----> 1 _, b, c = "refs/heads/my/branch".split('/')

ValueError: too many values to unpack (expected 3)

The entry is skipped.

feature request: Adding option to private hosted GitHub/GitLab repo

As in the title, it would be better if we can add custom url for private hosted GitLab/GitHub. This is because when dealing with private hosted repo, I have to use the usual nix-prefetch-git which the output contain unnecessary information such as url and rev and not like the output of nix-prefetch-github.

Is it possible?

Error: Internal Error: Calculate hash value for sources

This project suddently stopped working on my macos. I'm getting the following error regardless of which repo I choose as argument:

nix-prefetch-github seppeljordan nix-prefetch-github
Error: Internal Error: Calculate hash value for sources in github repo seppeljordan/nix-prefetch-github.

I'm using

nix-prefetch-github --version
nix-prefetch-github, version 2.3.2

It used to work. Not sure what's going on..

sha256 empty due to missing 'nix-command' experimental feature

When I run nix-prefetch-github, this is what happens:

$ nix-prefetch-github -v --rev c87c9a1467e57250977c24154e36f7e88c69ab41 eprover eprover
INFO: Running command: which nix-prefetch-url
INFO: Running command: which nix-prefetch-git
INFO: Running command: nix-prefetch-url --unpack https://github.com/eprover/eprover/archive/c87c9a1467e57250977c24154e36f7e88c69ab41.tar.gz
INFO: path is '/nix/store/hvk9k0qa4yk473n1ra0cwi5sjisw21f8-c87c9a1467e57250977c24154e36f7e88c69ab41.tar.gz'

INFO: Running command: nix hash to-sri sha256:169417z80nqx00ka1lvwl329wbab6sxvsxdq1pzxmrjk1qpb93vh
INFO: error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override

{
    "owner": "eprover",
    "repo": "eprover",
    "rev": "c87c9a1467e57250977c24154e36f7e88c69ab41",
    "sha256": "",
    "fetchSubmodules": false,
    "leaveDotGit": false,
    "deepClone": false
}

As you can see, the sha256 hash is missing because the nix-command experimental feature is not enabled on my machine.

Wrong rev field when using tags?

It seems like nix-prefetch-github returns an incorrect rev field. Here are examples, based on a piece of software I'm currently trying to update in nixpkgs:

$ nix-prefetch-github --no-prefetch --rev 5.11.0 sensu sensu-go
{
    "owner": "sensu",
    "repo": "sensu-go",
    "rev": "0b590a0a8e6a1ca31b2b5ab0f381eea51af3064d",
    "sha256": "05dx0nxcjl6fy68br2a37j52iz71kvqnqp29swcif2nwvq7w8mxx"
}

sensu/sensu-go@0b590a0 doesn't exist. The 5.11.0 tag in that repo is pointing to sensu/sensu-go@dd8f160

I'm fairly new to nix, so maybe I'm doing something wrong or misunderstanding something?

$ nix-prefetch-github --version
nix-prefetch-github, version 2.3.1

Specify release

First of all, thank you for this package!

Is it possible to specify the release in nix-prefetch-github using CLI? I couldn't find anything in the README and there is no man page for it.

Thank you!

Error: Internal Error: Calculate hash value for sources

I think I'm using nix-prefetch-github from NixOS stable channel.

/nix/store/l2pwcxh72i854q3dpn2gzwwa558d309l-nix-prefetch-github-1.3/bin/nix-prefetch-github

$ nix-prefetch-github --rev 3e704f3b3f55d7a864efb2a3ae2d84e3a54512bc bbigras wlroots

Error: Internal Error: Calculate hash value for sources in github repo bbigras/wlroots.

output was: building '/nix/store/rfjcq0fcmiz7masslf7q27xs012v6mnp-source.drv'...

trying https://github.com/bbigras/wlroots/archive/3e704f3b3f55d7a864efb2a3ae2d84e3a54512bc.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   157    0   157    0     0    585      0 --:--:-- --:--:-- --:--:--   583
100  459k    0  459k    0     0   655k      0 --:--:-- --:--:-- --:--:--  655k
unpacking source archive /build/3e704f3b3f55d7a864efb2a3ae2d84e3a54512bc.tar.gz
hash mismatch in fixed-output derivation '/nix/store/7pzdkrl1ddw9blkr4jymwavbxmxxdwm1-source':
  wanted: sha256:1y4ly7lgqm03wap4mh01yzcmvryp29w739fy07zzvz15h2z9x3dv
  got:    sha256:0x1x9dq4hnkdrdfbvcm6kaivrkgmmr4vp2qqwz15y5pcawvyd0z6
error: build of '/nix/store/rfjcq0fcmiz7masslf7q27xs012v6mnp-source.drv' failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.