Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
NotificationsYou must be signed in to change notification settings

DataShades/ckan-deps-installer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

CopyMakefile into the root of you main CKAN exntension and runmake prepare. This command will download the latest version of scripts for managingportal dependencies.

Instead of copying Makefile manually, if you haveckanext-toolbelt installed, youcan use the following command:

ctb make config deps-makefile> Makefile

Usage

Runmake prepare before using any of the commands below.

Whenever it's possible, consider using PyPI andrequirements.txt(orsetuptools'install_requires option). And only if extensions is not publishedto PyPI(or you need specific branch/tag/commit) use current tool.

Add all extensions required by your portal to the Makefile(it containsckanext-spatial as an example) and runmake full-upgrade to synchronize andinstall dependencies.

Any new dependency requires two changes in Makefile:

  1. Add extension alias toext_list variable.
  2. Describe the alias using syntax:
    remote-ALIAS = REPOSITORY_URL REFERENCE_TYPE REFERENCE

You can use any word as alias, but the simplest option is to use extensionname. For example:

  • usescheming as alias forckanext-scheming and start alias' description withremote-scheming = ...
  • usedcat as alias forckanext-dcat and start alias' description withremote-dcat = ...
  • usespatial as alias forckanext-spatial and start alias' description withremote-spatial = ...

Repository URL is the same as one, you are using forgit clone REPOSITORY_URL. For example:

Reference type is one of the following:

  • branch if you want to use specific branch of the project
  • tag if you want to use specific tag of the project
  • commit if you want to use specific commit of the project

The best choice istag, because it's self-descriptive. If tag is notavailable, prefer usingcommit, because it guarantees predictable build. Andonly when none of above is available(or you are not afraid of accidentalbreaking changes), usebranch

The last part, reference, is a name of the git object you are referring to:

  • if reference type set totag, it can bev1.2.3
  • if reference type set tocommit, it can befa38c1e5
  • if reference type set tobranch, it can bemaster

Now you can do the following:

  • Synchronize(download missing and switch existing to correct tag/commit/branch) specific extension using its alias:

    make sync-ALIAS# for example: make sync-spatial
  • Install specific extension using its alias. This command will install extension itself, and itsrequirements.txt if available.

    make install-ALIAS# for example: make install-spatial
  • Synchronize and install all extensions:

    make sync install
  • Synchronize and install CKAN, all extensions and current extension(one, that contains Makefile):

    make full-upgrade

If you want to install extra packages(pip install my_pkg[extra1,extra2]), add following variable to the Makefile:

package_extras-remote-ALIAS = extra1,extra2

For example, if you want to installtest extras for scheming and you definedscheming asremote-scheming, you need the following line:

package_extras-remote-scheming =test

If you are using alternatives(<alternative>-<alias>, described below), replaceremote part with an alternative name. I.e, foralternative=dev, you need to adapt extras definition in the following way:

package_extras-dev-scheming =test

Commands

CommandDescription
versioncheck if current version of installer is correct
prepareDownload/updatedeps.mk file, that contains the main logic
listlist all dependencies
ckanext-ALIASclone the extension if missing and checkout to the required state
ckanextperform ckanext-ALIAS for every single dependency
sync-ALIASclone, update origin, reset changes and checkout the extension
syncperform sync-ALIAS for every single dependency
install-ALIASinstall the extension and its pip-requirements
installperform install-ALIAS for every single dependency
ckan-checkverify CKAN version
check-ALIAScheck whether the extension is in required state
checkperform check-ALIAS for every single dependency and dockan-check
ckanclone CKAN repository
ckan-syncset CKAN to the expected tag
ckan-installinstall CKAN with its requirements
self-installinstall current extension and its requirements
full-upgradesynchronize and install everything(it is just a combination ofsync ckan-sync install ckan-install self-install)
local-indexdownload all the requirements. This allows you to install the project withlocal=1 flag even without internet access

In addition, some commands can behave differently when additional flags(x=y)added to the command. For example,install command can installdev-requirements.txt if flagdevelop=1 added:

make install develop=1
CommandsFlagExampleBehavior
sync*alternative=PREFIXalternative=devtry using<prefix>-<ext>(i.e,dev-spatial instead ofremote-spatial) definition of extensions before falling back toremote-<ext>. Default alternative value isremote
install*develop=ANYTHINGdevelop=1install dev-requirements if present
install*local=ANYTHINGlocal=1use local packages instead of PyPI(you need to build it first viamake local-index)
install*pyright_compatible=ANYTHINGpyright_compatible=1make sure pyright can find installed packages during typechecking(via exportingSETUPTOOLS_ENABLE_FEATURES="legacy-editable")
install*, local-indexindex=FOLDERindex=pypipath to local package index(relative to parent directory:../). By default: pypi

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp