No Description

Neal Gompa 9762a035ed Update chatroom reference to the new official Matrix room 2 weeks ago
alembic 9c2e410bfb Fix for mysql alembic migration 1 year ago
dev 691ed1bb3a fix: grammar of "log in" 2 months ago
doc 9762a035ed Update chatroom reference to the new official Matrix room 2 weeks ago
fedmsg.d 73d1200552 Project wide black fixes, including tests, docs and all 4 years ago
files 691ed1bb3a fix: grammar of "log in" 2 months ago
pagure 02a5830dc8 Add config option to restrict creating by OIDC groups 2 months ago
pagure-ev 07be9a824d (#2127569) Fixes TypeError: BaseEventLoop.create_server() got an unexpected keyword argument 'loop' 1 year ago
pagure-milters d773bb2be5 Make the milter discard the messages when it's done 2 years ago
tests 691ed1bb3a fix: grammar of "log in" 2 months ago
utils 85f82260ee Drop remaining nose files and requirements 2 years ago
.cico.pipeline 3fe86d83db Fix the issues with the duffy client 1 year ago
.flake8 a6b52c1146 Adjust pagure's source code for the newer flake8 3 years ago
.gitignore 437bdfa6bf Adding to .gitignore file 3 years ago
.pylintrc 254a80ed21 pylintrc: be more specific about generated-members 6 years ago
LICENSE 96994225ac Add the GPLv2 LICENSE file 9 years ago f8d23a53ad Clean up the file since we dropped some folders 5 years ago
README.rst 9762a035ed Update chatroom reference to the new official Matrix room 2 weeks ago
UPGRADING.rst 3a32d9e38d Document MySQL migration issue 1 year ago 73d1200552 Project wide black fixes, including tests, docs and all 4 years ago 75f7c960ea Add orphaning reason 3 years ago
pagure_logo.svg 43167e1e09 update the logo 7 years ago
pyproject.toml 5eb40d6138 style: set 'black' target version = py39 8 months ago
requirements-ci.txt c9376756f7 build(requirements): pin python package versions 8 months ago
requirements-ev.txt c9376756f7 build(requirements): pin python package versions 8 months ago
requirements-fedora.txt da0c1b6eef Add a dependency on flask-oidc for testing 2 years ago
requirements-optional.txt 71c8894fd4 Re-structure how are requirements are listed 6 years ago
requirements-testing.txt 7d6573a31c build(requirements): pin 'itsdangerous' to < 2.1 8 months ago
requirements-webhook.txt 33bdcafbcf trollius → trololio 5 years ago
requirements.txt 7d6573a31c build(requirements): pin 'itsdangerous' to < 2.1 8 months ago 1d70c7f1fd Finish replacing CentOS 7 with CentOS Stream 8 in CI 2 years ago 73d1200552 Project wide black fixes, including tests, docs and all 4 years ago d11ec7e9ef Add cert and key args to 2 months ago 56cfd67754 Reorder celery arguments (and s/info/INFO/) 2 years ago 677a9ab2a3 Drop Python 2 support in spec file and requirements 2 years ago
tox.ini 6e1b839dc8 build(tox): align used pkgs, remove py35 and py36 8 months ago



:Author: Pierre-Yves Chibon

Pagure is a git-centered forge, python based using pygit2.

With pagure you can host your project with its documentation, let your users
report issues or request enhancements using the ticketing system and build your
community of contributors by allowing them to fork your projects and contribute
to it via the now-popular pull-request mechanism.


See it at work:

Playground version:

If you have any questions or just would like to discuss about pagure,
feel free to drop by `our Matrix room `_.

About its name

The name Pagure is taken from the French word 'pagure'. Pagure in French is used as the
common name for the crustaceans from the `Paguroidea `_
superfamily, which is basically the family of the Hermit crabs.

Originating from French it is pronounced with a strong 'g' as you can hear
on `this recording `_.

Get it running

There are several options when it comes to a development environment.
They are: Docker Compose, Vagrant, and manual. Choose an option below.

Docker Compose
Docker Compose will provide you with a container which you can develop on.
Install it `with these instructions `_.

For more information about docker-compose cli, see:

To build and run the containers, use the following command::

$ ./dev/

Once all the containers have started, you can access pagure on http://localhost:5000.
To stop the containers, press Ctrl+C.

Once the containers are up and running, run this command to populate the
container with test data and create a new account ::

$ docker-compose -f dev/docker-compose.yml exec web python3 --all

You can then log in with any of the created users, by example:

- username: pingou
- password: testing123


For a more thorough introduction to Vagrant, see

An example Vagrantfile is provided as ``Vagrantfile.example``. To use it,
just copy it and install Vagrant. Instructions for Fedora::

$ cp dev/Vagrantfile.example Vagrantfile
$ sudo dnf install ansible libvirt vagrant-libvirt vagrant-sshfs vagrant-hostmanager
$ vagrant up

On Ubuntu, install Vagrant directly `from the website `_
then run these commands instead::

$ cp dev/Vagrantfile.example Vagrantfile
$ sudo add-apt-repository ppa:ansible/ansible
$ sudo apt update
$ sudo apt install ansible libvirt0 openssh-server qemu libvirt-bin ebtables dnsmasq libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
$ vagrant plugin install vagrant-libvirt vagrant-sshfs vagrant-hostmanager

If you get this error ``Block in synced_folders: Internal error. Invalid: sshfs``,
when you run ``vagrant up`` , you need to install vagrant sshfs plugin, which can be done by::

$ vagrant plugin install vagrant--sshfs

and then::

$ vagrant up

The default ``Vagrantfile`` forwards ports from the host to the guest,
so you can interact with the application as if it were running on your
host machine.

.. note::
``vagrant-hostmanager`` will automatically maintain /etc/hosts for you so you
can access the development environment from the host using its hostname, which
by default is ````. You can choose not to use this
functionality by simply not installing the ``vagrant-hostmanager`` plugin, but
if you want Pagure to provide valid URLs in the UI for git repositories, you
will need to adjust Pagure's configuration found in ~/pagure.cfg on the guest.

When the vagrant VM is up and running, connect to it with::

$ vagrant ssh

This will log you into the VM as the user ``vagrant`` which has a couple of aliases

$ pstart # Starts pagure, the workers and other tasks
$ pstop # Stops all those tasks again
$ pstatus # Shows pagure status

The Vagrant pagure doesn't have its own log file, use ``journalctl -f`` to
show the pagure output. The verbosity can be configured in the pagure config file
with the ``LOGGING`` parameter.

Running the unit-tests in container

To run the unit-tests, there are containers available with all the dependencies needed.

First you will need to have podman and git installed on your workstation. ::

$ sudo dnf install podman git

Use the following command to run all tests on all container images, if the images not exist on your system, they will be build ::

$ ./dev/

If you wish to execute the test suite on a centos based container run the following command ::

$ ./dev/ --centos

Container images are separated from the pagure source that will be tested.
Therefore they will only automatically build if they not exist.

A manual rebuild should be done from time to time to include new package versions.
Also if you work on any changes in the pagure spec file, the tox config or any requirements.txt file,
perform a rebuild to ensure your changed will taken into account. ::

$ ./dev/ --rebuild # all base and code container
$ ./dev/ --rebuild-code # code container only

You can also run a single test case ::

$ ./dev/ tests/

Or a single test ::

$ ./dev/ tests/

You can also get ``run-tests-container`` help ::

$ ./dev/ --help

By default, tests run against the git repo and the active branch in the current folder.
To override this behavior and run the tests on your remote development branch in your fork ::

$ ./dev/ --repo --branch

.. note:: All build, test and shell activities executed via ``run-tests-container`` will automatically be logged.
Every container has it's own ``dev/results_`` folder, every run creates separate
files with the current unix timestamp as prefix. You should cleanup this folder from time to time.

Running the unit-tests in tox

You can run the tests using tox. This allows you to run the tests on local version of the code.

.. note:: This way of running tests could help you test your local changes,
but the output could be different then from the containerized tests.
Always check your branch after push with containerized tests as well.

* Install the needed system libraries::

sudo dnf install libgit2-devel redis gcc tox python-alembic

.. note:: You can also install any missing python interpreter.
For example `sudo dnf install python35`

* Run the whole test suite::


* Or just single environment::

tox -e py39

* Or single module::

tox tests/


* Install the needed system libraries::

sudo dnf install git python3 python3-devel libgit2-devel redis \
libjpeg-devel gcc libffi-devel redhat-rpm-config

.. note:: Do note the version of libgit2 that you install, for example
in ``libgit2-0.26.8-1`` you need to keep in mind the ``0.26``

.. note:: On RHEL and derivative (CentOS, Scientific Linux) there is no
`python3` package. Just `python36` or `python34` available in
EPEL 7 (EPEL 6 only has `python34`). Choose the one you prefer
(3.6 is newer and generally a better choice).

* Retrieve the sources::

git clone
cd pagure

* Install dependencies

* create the virtual environment (use `python3.X` explicitly on EPEL)::

python3 -m venv pagure_env
source ./pagure_env/bin/activate

* Install the correct version of pygit2::

pip install pygit2==.*

So in our example::

pip install pygit2==0.26.*

* Install the rest of the dependencies::

pip install -r requirements.txt

* Create the folder that will receive the projects, forks, docs, requests and
tickets' git repo::

mkdir -p lcl/{repos,remotes,attachments,releases}

* Copy and edit the alembic.ini file (especially the ``script_location`` key)::

cp files/alembic.ini .
vim alembic.ini

* Set the ``script_location`` to ``alembic``, ie: the folder where the revisions
are stored, relative to the location of the ``alembic.ini`` file.

* Create the inital database scheme::

python --initial alembic.ini

* Enable and start redis server::

sudo systemctl enable redis
sudo systemctl start redis

* Start a worker, in one terminal::


* Run the application, in another terminal::


* To get some profiling information you can also run it as::

./ --profile

This will launch the application at

* To run unit-tests on pagure

* Install the dependencies::

pip install -r requirements-testing.txt

* Run it::

pytest tests/

.. note:: While testing for worker tasks, pagure uses celery in /usr/bin/
Celery then looks for eventlet (which we use for testing only) at
system level and not in virtual environment. You will need to
install eventlet outside of your virtual environment if you are
using one.

.. note:: This will also work in vagrant.