Skip to main content

Development package manager

Project description

devpm

Development package manager

Usage

  • devpm install - Install packages by devpackage.json in current directory which support config:
    • vscodeDependencies for vscode extensions
    • vscodeUserSettings for edit vscode user settings file
    • pythonDependencies for python modules
    • bashDependencies for custom bash script
    • gitHooks for add git hooks like pre-commit, commit-msg
  • devpm pr - Create a Pull Request
  • devpm cr - Create a Code Review, same to devpm pr
  • devpm run [NAME] - Run [NAME] script in devpackage.json
  • devpm lint - Run lint script in devpackage.json. Equal to devpm run lint
  • devpm test - Run test script in devpackage.json. Equal to devpm run test
  • devpm start - Run start script in devpackage.json. Equal to devpm run start
  • devpm stop - Run stop script in devpackage.json. Equal to devpm run stop
  • devpm restart - Run restart script in devpackage.json. Equal to devpm run restart
  • devpm version - Bump a package version and auto-gen CHANGELOG. (not yet finished)

devpm --help for more details.

devpackage.json

vscodeDependencies

Packages installed by visutal studio code. Key for vscode extension id, value for version (1). Version definition:

  • "" (empty) - install when not exists
  • "latest" - uninstall and install latest
  • "1.0.0" (specified) - install when version mismatched

pythonDependencies

Packages installed by pip. Key for pip name, value for version, ses (1).

bashDependencies

Packages installed by custom bash script. Key for excutable name after installed, value is an object describes script in platforms. The platform is from python sys.platform, include 'darwin', 'win32' and 'linux'.

vscodeUserSettings

Write to visual studio code user settings https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations. Key and value format same to the user settings. In addition, the value support devpm expression:

  • $bash.which:[bin] - returns the bin path in system by which [bin]
  • $pip.which:[bin] - returns the bin path in pip by pip show [bin]

gitHooks

Write to git hooks for root project and it's git submodules. Support commit-msg, pre-commit.

commit-msg

type (string) now is always regexp, for custom regexp match. pattern (string) for the regexp pattern. tips (array) used to show tips when the commit-msg mismatched, each item for one line.

pre-commit

type (string) now is always pre-commit, use thepre-commit plugin https://pre-commit.com/. repos (array) content is same to '.pre-commit-config.yaml' but in json format.

Example

{
  "$schema": "https://raw.githubusercontent.com/wequick/devpm/main/devpackage.schema.json",
  "vscodeDependencies": {
    "ms-vscode.cpptools-extension-pack": "",
    "wequick.filegen": "",
    "wequick.coverage-gutters": "",
    "mine.cpplint": "",
    "ms-python.pylint": ""
  },
  "vscodeUserSettings": {
    "cpplint.cpplintPath": "$pip.which:cpplint",
    "cmake.cmakePath": "$bash.which:cmake"
  },
  "pythonDependencies": {
    "gcovr": "4.2",
    "cpplint": "1.6.1",
    "pre-commit": "3.3.3"
  },
  "bashDependencies": {
    "OpenCppCoverage": {
      "win32": "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.9.0/OpenCppCoverageSetup-x64-0.9.9.0.exe"
    },
    "cppcheck": {
      "win32": "https://github.com/danmar/cppcheck/releases/download/2.11/cppcheck-2.11-x64-Setup.msi",
      "linux": "apt-get install cppcheck",
      "darwin": "brew install cppcheck"
    }
  },
  "gitHooks": {
    "commit-msg": {
      "type": "regexp",
      "pattern": [
        "^(feat|fix|refactor|chore|test|style|docs)",
        "^(Merge)"
      ],
      "tips": [
        "Invalid commit message style, please format as following:",
        "  fix: some msg",
        "  ^^^^              Type: feat|fix|refactor|chore|test|style|docs",
        "       ^^^^^^^^     Summary in present tense",
        "Type:",
        "  feat     : new feature for the user, not a new feature for build script",
        "  fix      : bug fix for the user, not a fix to a build script",
        "  docs     : changes to the documentation",
        "  style    : formatting, missing semi colons, etc; no production code change",
        "  refactor : refactoring production code, eg. renaming a variable",
        "  test     : adding missing tests, refactoring tests; no production code change",
        "  chore    : updating grunt tasks etc; no production code change",
        "",
        "See <https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716> for more details.",
        ""
      ]
    },
    "pre-commit": {
      "type": "pre-commit",
      "repos": [
        {
          "repo": "https://github.com/pocc/pre-commit-hooks",
          "rev": "v1.3.5",
          "hooks": [
            { "id": "cpplint" },
            {
              "id": "cppcheck",
              "args": [
                "--suppress=missingInclude",
                "--suppress=missingIncludeSystem",
                "--std=c++14",
                "--force"
              ]
            }
          ]
        }
      ]
    }
  },
  "scripts": {
    "prestart": "echo prestart",
    "start": "echo prestart",
    "poststart": "echo poststart",
    "version": "devpm --version"
  }
}

Develop

$ python src/devpm/__main__.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devpm-1.2.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devpm-1.2.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file devpm-1.2.0.tar.gz.

File metadata

  • Download URL: devpm-1.2.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for devpm-1.2.0.tar.gz
Algorithm Hash digest
SHA256 cdd1bc24cacccb63bcef4caf63f5d5119465ce2045a3ba56be312532292e3da9
MD5 602306f21e69846ec06da625e19a5260
BLAKE2b-256 0b18ca2d6ecac860984410c70cab3e8b7ef62b19d7044797776f79d8a4bbc12c

See more details on using hashes here.

File details

Details for the file devpm-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: devpm-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for devpm-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20c257c95aeab0c3a8ee768222be80a5d022ee923a5839f76cb6b04bb7d91e33
MD5 e0111c0a04eecfb693ebcbd057bba2df
BLAKE2b-256 a2eb56f553a80216540cf9f7e282a5e2ae437f43ab19daa4f6b20248a6d6cac3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page