ocflib


Nameocflib JSON
Version 2024.4.21 PyPI version JSON
download
home_pageNone
Summarylibraries for account and server management
upload_time2024-04-22 06:01:52
maintainerNone
docs_urlNone
authorOpen Computing Facility
requires_python<3.12,>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ocflib

[![Build Status](https://jenkins.ocf.berkeley.edu/buildStatus/icon?job=ocf/ocflib/master)](https://jenkins.ocf.berkeley.edu/job/ocf/job/ocflib/job/master)
[![Coverage Status](https://coveralls.io/repos/github/ocf/ocflib/badge.svg?branch=master)](https://coveralls.io/github/ocf/ocflib?branch=master)
[![PyPI version](https://badge.fury.io/py/ocflib.svg)](https://pypi.org/project/ocflib/)

ocflib is a Python library for working with [Open Computing Facility][ocf]
services (in particular, accounts and server management).

The library targets Python 3.5.3 and 3.7 (the versions available in Debian
stretch and buster).

The goal of the library is to make it easier to re-use OCF python code. In the
past, code was split between approve, atool, create, chpass, sorry, signat,
etc., which made it difficult to do things like share common password
requirements.

## What belongs here

In general, code which can be re-used should be here, but standalone
applications or binaries shouldn't. For example, [ocfweb][ocfweb] uses ocflib
code to change passwords and create accounts, but the Django web app doesn't
belong here.

## Using on OCF

ocflib is installed by [Puppet][puppet] on the OCF, so you can simply do things
like `import ocflib.lab.stats` from the system python3 installation. We _don't_
install it to python2 site-packages.

We build [a Debian package][debian-pkg] which is installed by Puppet. We also
publish new versions to [PyPI][pypi], which is useful because it allows easy
installation into virtualenvs.

## Note about lockfiles

This repository includes a `poetry.lock` file. Lockfiles are usually used to
ensure that the exact same versions of dependencies are installed across
different machines. However, as this is a library, we don't want to force
downstream users to use the exact same versions of dependencies as us, and
indeed, the lockfile is ignored when distributing. We still include it in the
repository to make it easier to develop, test, and debug ocflib.

## Installing locally

### For Testing Changes

Development of ocflib uses [Poetry](https://python-poetry.org/). The easiest way
to test changes to ocflib is to let Poetry manage the virtual environment for
you:

    poetry install
    poetry shell

Now, if you import something from ocflib, you'll be using the version from your
working copy.

### Testing and linting

We use pytest to test our code, and pre-commit to lint it. You should run
`make test` before pushing to run both.

The `tests` directory contains automated tests which you're encouraged to add to
(and not break). The `tests-manual` directory contains scripts intended for
testing.

#### Using pre-commit

We use [pre-commit][pre-commit] to lint our code before commiting. While some of
the rules might seem a little arbitrary, it helps keep the style consistent, and
ensure annoying things like trailing whitespace don't creep in.

You can simply run `make install-hooks` to install the necessary git hooks; once
installed, pre-commit will run every time you commit.

Alternatively, if you'd rather not install any hooks, you can simply use
`make test` as usual, which will also run the hooks.

### Troubleshooting: Cracklib Error

If you're trying to run make install-hooks on ocfweb (or related repos) and get
this error:

```
./_cracklib.c:40:10: fatal error: 'crack.h' file not found
  #include <crack.h>
           ^~~~~~~~~
  1 error generated.
```

The issue relates to the cracklib package not finding the necessary header files
to install. Make sure cracklib is installed on your machine
(https://github.com/cracklib/cracklib, if you're on Mac,
`brew install cracklib`).

## Deploying changes

Deploying changes involves:

- Running tests and linters
- Pushing a new version to [PyPI][pypi]
- Building a Debian package
- Pushing the Debian package to our internal [apt][apt]

[Jenkins][jenkins] will automatically perform all of these steps for you on
every push, including automatically generating a new version number. As long as
`make test` passes, your code will be automatically deployed. You can monitor
the progress of your deploy [here][jenkins].

[ocf]: https://www.ocf.berkeley.edu/
[ocfweb]: https://github.com/ocf/ocfweb/
[puppet]: https://github.com/ocf/puppet/
[pypi]: https://pypi.python.org/pypi/ocflib
[apt]: http://apt.ocf.berkeley.edu/
[jenkins]: https://jenkins.ocf.berkeley.edu/view/ocflib-deploy/
[debian-pkg]: http://apt.ocf.berkeley.edu/pool/main/p/python-ocflib/
[pre-commit]: http://pre-commit.com/


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ocflib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Open Computing Facility",
    "author_email": "help@ocf.berkeley.edu",
    "download_url": "https://files.pythonhosted.org/packages/eb/f7/4059245367c1454961ebb6116cfece6c8bf7491d01d6ed72efa06b74d38c/ocflib-2024.4.21.tar.gz",
    "platform": null,
    "description": "# ocflib\n\n[![Build Status](https://jenkins.ocf.berkeley.edu/buildStatus/icon?job=ocf/ocflib/master)](https://jenkins.ocf.berkeley.edu/job/ocf/job/ocflib/job/master)\n[![Coverage Status](https://coveralls.io/repos/github/ocf/ocflib/badge.svg?branch=master)](https://coveralls.io/github/ocf/ocflib?branch=master)\n[![PyPI version](https://badge.fury.io/py/ocflib.svg)](https://pypi.org/project/ocflib/)\n\nocflib is a Python library for working with [Open Computing Facility][ocf]\nservices (in particular, accounts and server management).\n\nThe library targets Python 3.5.3 and 3.7 (the versions available in Debian\nstretch and buster).\n\nThe goal of the library is to make it easier to re-use OCF python code. In the\npast, code was split between approve, atool, create, chpass, sorry, signat,\netc., which made it difficult to do things like share common password\nrequirements.\n\n## What belongs here\n\nIn general, code which can be re-used should be here, but standalone\napplications or binaries shouldn't. For example, [ocfweb][ocfweb] uses ocflib\ncode to change passwords and create accounts, but the Django web app doesn't\nbelong here.\n\n## Using on OCF\n\nocflib is installed by [Puppet][puppet] on the OCF, so you can simply do things\nlike `import ocflib.lab.stats` from the system python3 installation. We _don't_\ninstall it to python2 site-packages.\n\nWe build [a Debian package][debian-pkg] which is installed by Puppet. We also\npublish new versions to [PyPI][pypi], which is useful because it allows easy\ninstallation into virtualenvs.\n\n## Note about lockfiles\n\nThis repository includes a `poetry.lock` file. Lockfiles are usually used to\nensure that the exact same versions of dependencies are installed across\ndifferent machines. However, as this is a library, we don't want to force\ndownstream users to use the exact same versions of dependencies as us, and\nindeed, the lockfile is ignored when distributing. We still include it in the\nrepository to make it easier to develop, test, and debug ocflib.\n\n## Installing locally\n\n### For Testing Changes\n\nDevelopment of ocflib uses [Poetry](https://python-poetry.org/). The easiest way\nto test changes to ocflib is to let Poetry manage the virtual environment for\nyou:\n\n    poetry install\n    poetry shell\n\nNow, if you import something from ocflib, you'll be using the version from your\nworking copy.\n\n### Testing and linting\n\nWe use pytest to test our code, and pre-commit to lint it. You should run\n`make test` before pushing to run both.\n\nThe `tests` directory contains automated tests which you're encouraged to add to\n(and not break). The `tests-manual` directory contains scripts intended for\ntesting.\n\n#### Using pre-commit\n\nWe use [pre-commit][pre-commit] to lint our code before commiting. While some of\nthe rules might seem a little arbitrary, it helps keep the style consistent, and\nensure annoying things like trailing whitespace don't creep in.\n\nYou can simply run `make install-hooks` to install the necessary git hooks; once\ninstalled, pre-commit will run every time you commit.\n\nAlternatively, if you'd rather not install any hooks, you can simply use\n`make test` as usual, which will also run the hooks.\n\n### Troubleshooting: Cracklib Error\n\nIf you're trying to run make install-hooks on ocfweb (or related repos) and get\nthis error:\n\n```\n./_cracklib.c:40:10: fatal error: 'crack.h' file not found\n  #include <crack.h>\n           ^~~~~~~~~\n  1 error generated.\n```\n\nThe issue relates to the cracklib package not finding the necessary header files\nto install. Make sure cracklib is installed on your machine\n(https://github.com/cracklib/cracklib, if you're on Mac,\n`brew install cracklib`).\n\n## Deploying changes\n\nDeploying changes involves:\n\n- Running tests and linters\n- Pushing a new version to [PyPI][pypi]\n- Building a Debian package\n- Pushing the Debian package to our internal [apt][apt]\n\n[Jenkins][jenkins] will automatically perform all of these steps for you on\nevery push, including automatically generating a new version number. As long as\n`make test` passes, your code will be automatically deployed. You can monitor\nthe progress of your deploy [here][jenkins].\n\n[ocf]: https://www.ocf.berkeley.edu/\n[ocfweb]: https://github.com/ocf/ocfweb/\n[puppet]: https://github.com/ocf/puppet/\n[pypi]: https://pypi.python.org/pypi/ocflib\n[apt]: http://apt.ocf.berkeley.edu/\n[jenkins]: https://jenkins.ocf.berkeley.edu/view/ocflib-deploy/\n[debian-pkg]: http://apt.ocf.berkeley.edu/pool/main/p/python-ocflib/\n[pre-commit]: http://pre-commit.com/\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "libraries for account and server management",
    "version": "2024.4.21",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae61549d39c3f6fd87836e94898ba2bab31d8ef0286a3493c76323147e9dac75",
                "md5": "fcdb29b7e78a2b6d51a8e0c6f202dffd",
                "sha256": "196c09442e8dabf49eea2f4fd66bfa85d5398fe2c69184de80922b3c791039c9"
            },
            "downloads": -1,
            "filename": "ocflib-2024.4.21-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fcdb29b7e78a2b6d51a8e0c6f202dffd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.7",
            "size": 78940,
            "upload_time": "2024-04-22T06:01:46",
            "upload_time_iso_8601": "2024-04-22T06:01:46.936121Z",
            "url": "https://files.pythonhosted.org/packages/ae/61/549d39c3f6fd87836e94898ba2bab31d8ef0286a3493c76323147e9dac75/ocflib-2024.4.21-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebf74059245367c1454961ebb6116cfece6c8bf7491d01d6ed72efa06b74d38c",
                "md5": "bb275ab4e234f578d3484a664586c0bc",
                "sha256": "909dbe329a18a32cd8e8f66542fb73aa9604e013b0e3551d20615caf353bac23"
            },
            "downloads": -1,
            "filename": "ocflib-2024.4.21.tar.gz",
            "has_sig": false,
            "md5_digest": "bb275ab4e234f578d3484a664586c0bc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.7",
            "size": 68082,
            "upload_time": "2024-04-22T06:01:52",
            "upload_time_iso_8601": "2024-04-22T06:01:52.042064Z",
            "url": "https://files.pythonhosted.org/packages/eb/f7/4059245367c1454961ebb6116cfece6c8bf7491d01d6ed72efa06b74d38c/ocflib-2024.4.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 06:01:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ocflib"
}
        
Elapsed time: 0.24785s