Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7381c27
add pipfile.lock so that dependabot can detect versions
Dec 11, 2025
2cf81c2
Update GitHub Actions runner to ubuntu-latest
clarktr1 Dec 12, 2025
90a8795
Update test.yml
clarktr1 Dec 12, 2025
adb632a
update sphinx for tests
Dec 12, 2025
b1eadd7
update requirements
Dec 12, 2025
17137a1
update sphinx config
Dec 12, 2025
4589719
disable pytest plugins
Dec 12, 2025
d00e659
update test dependencies
Dec 12, 2025
aede59a
update tox
Dec 12, 2025
477e3c9
update more tox configs to allow runtests
Dec 12, 2025
50f920c
change tox config once again...
Dec 12, 2025
cc1badd
change tox config once again....
Dec 12, 2025
b39895d
change tox config once again.....
Dec 12, 2025
d3f317e
remove Pipfiles and update docs yaml
Dec 12, 2025
3dd364c
adjust versions to not be as strict within range
Dec 12, 2025
82db193
add pyproject&poetry with updated docker commands
Jan 6, 2026
f92f5af
small change to pyprpoject and readme
Jan 6, 2026
d537905
remove poetry from pyproject and allow pip can handle dependencies o…
Jan 20, 2026
385a800
add lockfile
Jan 20, 2026
a749b00
lock poetry version, change install for docker to pip
Jan 20, 2026
d50c191
remove poetry from docker
Jan 20, 2026
9aa5b99
remove deprecated version header & add optional dependencies to install
Jan 21, 2026
2ee97e7
apparently version is not deprecated
Jan 21, 2026
6bd0d97
adjust tox deps groups
Jan 21, 2026
6c799fd
remove poetry
Jan 21, 2026
80aa7ad
remove poetry lock
Jan 21, 2026
3c3c1b8
remove path and curl install
Jan 21, 2026
89e514e
adjust contributors
Jan 21, 2026
7357459
add test for version checking, update readme, remove redundant steps …
Jan 23, 2026
18d8b94
adjust capitalization to check git author
clarktr1 Jan 23, 2026
adfd1ca
fix README wording and adjust version assertion
clarktr1 Jan 29, 2026
c2357f7
update readme with readthedocs link, add pytest-cov min version
clarktr1 Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on: [push, pull_request, workflow_dispatch]
jobs:

tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
Comment thread
somexpert marked this conversation as resolved.

steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Start the app
run: docker-compose up -d
run: docker compose up -d
- name: Run the tests and flake8
run: docker-compose run --rm web tox

run: docker compose run --rm web tox

2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
build:
os: "ubuntu-20.04"
os: "ubuntu-latest"
tools:
python: "3.9"
apt_packages:
Expand Down
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# vim: set ft=conf

FROM python:3.9

ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /app
ENV PYTHONDONTWRITEBYTECODE 1

RUN apt-get update -qq && \
apt-get install -y mariadb-server mariadb-client libmariadb-dev-compat libmariadb-dev libssl-dev
RUN mkdir /app
apt-get install -y \
mariadb-server mariadb-client \
libmariadb-dev-compat libmariadb-dev libssl-dev

WORKDIR /app
ADD requirements/ /app/requirements/
ADD requirements.txt /app/
RUN pip install -r requirements.txt

# Copy project files
COPY . /app/

# Install dependencies
RUN pip install .'[dev,test,codestyle]'
7 changes: 3 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include LICENSE
include *.txt *.md
recursive-include name/templates *
recursive-include name/static *
include *.txt
recursive-include name/templates *
recursive-include name/static *
recursive-include name/fixtures *
96 changes: 72 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Django Name [![Build Status](https://github.com/unt-libraries/django-name/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/unt-libraries/django-name/actions) [![Docs Status](https://img.shields.io/badge/docs-latest-blue.svg)](https://django-name.readthedocs.org) [![PyPI Version](https://img.shields.io/pypi/v/django-name.svg)](https://pypi.python.org/pypi/django-name)
# Django Name [![Build Status](https://github.com/unt-libraries/django-name/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/unt-libraries/django-name/actions) [![Docs Status](https://img.shields.io/badge/docs-latest-blue.svg)](https://django-name.readthedocs.io) [![PyPI Version](https://img.shields.io/pypi/v/django-name.svg)](https://pypi.python.org/pypi/django-name)
Python Implementation of NACO Normalization Rules

The Name App is a tool originally developed for documenting names used by the UNT Libraries in its various digital library systems and collections. The app provides a consistent way of communicating the authorized version of a name and information about the name that is useful for reuse. The Name App generates a unique URL for each name that can be used to unambiguously refer to a person, organization, event, building or piece of software. In addition to an HTML page for each name there are a number of other formats available for each record including a MADS XML version and a simple JSON representation. A key feature of the UNT Name App is the ability to link to other vocabularies such as the Virtual International Authority File (VIAF), the Library of Congress Name Authority File, or Wikipedia.
Expand All @@ -7,7 +7,7 @@ The Name App is a tool originally developed for documenting names used by the UN

## Installation

For installation instructions, see the [Installation](http://django-name.readthedocs.org/en/latest/installation.html) page in the docs.
For installation instructions, see the [Installation](https://django-name.readthedocs.io/en/latest/installation.html) page in the docs.

## License

Expand All @@ -26,18 +26,20 @@ Contributors:
- [Gio Gottardi](https://github.com/somexpert)
- [Madhulika Bayyavarapu](https://github.com/madhulika95b)
- [Gracie Flores-Hays](https://github.com/gracieflores)
- [Trey Clark](https://github.com/clarktr1)


## Developing
## Requirements
- Python 3.9 or later

To take advantage of the dev environment that is already configured, you need to have Docker(>= 1.3) and Docker Compose installed.

Install [Docker](https://docs.docker.com)
## Development

Install Docker Compose
```sh
$ pip install docker-compose
```
There are three ways to set up this environment locally.

## Docker

Install [Docker](https://docs.docker.com). Instructions differ based on installation method.

Clone the repository.
```sh
Expand All @@ -47,19 +49,19 @@ $ cd django-name

Warm up the Mariadb database. This only needs to be done when the database container doesn't exist yet. This will take about a minute once the image has been pulled.
```sh
$ docker-compose up -d mariadb
$ docker compose up -d mariadb
```

Start the app and run the migrations.
```sh
# start the app
$ docker-compose up -d
$ docker compose up -d

# run the migrations
$ docker-compose run --rm web ./manage.py migrate
$ docker compose run --rm web ./manage.py migrate

# optional: add a superuser in order to login to the admin interface
$ docker-compose run --rm web ./manage.py createsuperuser
$ docker compose run --rm web ./manage.py createsuperuser
```
At this point you should be able to access your local instance of the site by visiting `<dockerhost>:8000/name/`

Expand All @@ -69,19 +71,19 @@ However, if the requirements files change, it is important that you rebuild the

```sh
# stop the app
$ docker-compose stop
$ docker compose stop

# remove the web container
$ docker-compose rm web
$ docker compose rm web

# rebuild the web container
$ docker-compose build web
$ docker compose build web

# start the app
$ docker-compose up -d
$ docker compose up -d
```

#### Developing with Podman and Podman-Compose
## Developing with Podman and Podman-Compose
[Install or Enable Podman](https://podman.io/getting-started/installation).

[Install Podman Compose](https://github.com/containers/podman-compose).
Expand All @@ -93,16 +95,62 @@ You will follow the same steps as above, starting with `Clone the repository`. F

If you have SELinux, you may need to temporarily add `:Z` to the web volumes in the docker-compose.yml. It will look like `.:/app/:Z`. You may also need to use `sudo` for your podman-compose commands.

#### Running the Tests
To run the tests via Tox, use this command. If you are using podman-compose, swap the word `docker` with `podman` for the commands below.
## Traditional Setup

Clone the repository.
```sh
$ git clone https://github.com/unt-libraries/django-name.git
$ cd django-name
```

Comment thread
ldko marked this conversation as resolved.
Install the mysql development package. The command depends on your system:
```sh
# Red Hat
sudo dnf install mysql-devel

# Ubuntu / Windows (WSL)
sudo apt install libmysqlclient-dev

# macOS via Homebrew
brew install mysql-client
```

Create a virtual environment and activate it
```sh
$ python -m venv env
$ source env/bin/activate
```

Install the dev dependencies
```sh
$ pip install .'[dev,test,codestyle]'
```

Replace the `DATABASES` Django setting in `./tests/settings/dev.py` with
```python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': './db.sqlite3',
}
}
```
Add table data
```sh
$ docker-compose run --rm web tox
$ python manage.py migrate
```

To run the tests only with the development environment
Start dev instance
```sh
$ docker-compose run --rm web ./runtests.py
$ python manage.py runserver
```

Note: This is the same command that Tox issues inside each test environment it has defined.
The app should be available at `http://localhost:8000/name/`

## Running the Tests
NOTE: tests will not pass without the mariadb and postgres databases available.

To run the tests via Tox, use this command. If you are using podman-compose, swap the word `docker` with `podman` for the commands below.
```sh
$ docker compose run --rm web tox
```
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
mariadb:
image: mariadb:10.5
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
87 changes: 87 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "django-name"
description = "Name Authority App for Django."
readme = "README.md"
version = "5.0.0"
license = {file = 'LICENSE'}
keywords = ["django", "name", "citation"]
requires-python = ">=3.9,<4.0"
authors = [
{ name = "University of North Texas Libraries", email = "mark.phillips@unt.edu" }
]
classifiers = [
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: End Users/Desktop",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application"
]
dependencies = [
"python-dateutil==2.7.3",
"markdown2>=2.4.0",
"djangorestframework~=3.15.2",
"pynaco @ git+https://github.com/unt-libraries/pynaco",
]

[project.urls]
Homepage = "https://github.com/unt-libraries/django-name"
Repository = "https://github.com/unt-libraries/django-name"


[project.optional-dependencies]
codestyle = ["flake8"]
dev = [
"Django==4.2.27",
"django-debug-toolbar==3.8.1",
"mysqlclient==2.0.1",
]
test = [
"tox>=3.3.0",
"markdown2>=2.4.0",
"pytest>=7.1.0",
"pytest-django>=4.6.2",
"pytest-cov>=7.0.0",
"psycopg2-binary>=2.9.9",
"tomli>=2.0.1",
]

[tool.tox]
legacy_tox_ini ='''
[tox]
envlist =
py39-django42-{postgres,mariadb},
py39-flake8,
docs

[testenv]
passenv = DB_*
allowlist_externals = ./runtests.py
extras =
test
dev
codestyle
commands =
mariadb: ./runtests.py {posargs} --nolint --ds=tests.settings.test_mariadb
postgres: ./runtests.py {posargs} --nolint --ds=tests.settings.test_postgres

[testenv:py39-django42-mariadb]
commands =
./runtests.py {posargs} --nolint --ds=tests.settings.test_mariadb --cov=name
allowlist_externals = ./runtests.py

[testenv:py39-flake8]
commands =
./runtests.py --lintonly
allowlist_externals = ./runtests.py

[testenv:docs]
deps = Sphinx>=4.0
changedir = docs
commands = {envbindir}/sphinx-build -W -b html . {envtmpdir}/html
'''
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements/requirements-base.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements/requirements-codestyle.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/requirements-dev.txt

This file was deleted.

7 changes: 0 additions & 7 deletions requirements/requirements-test.txt

This file was deleted.

45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

Loading